Click here to Skip to main content
Click here to Skip to main content

rePaint in OnPaint - How to Clear graphics which has been painted before ( to effect new changes)

, 10 Aug 2011
Rate this:
Please Sign up or sign in to vote.
clear graphis onpaint
if you need to clear the clear the graphics which has been painted before use this tip:
if you need to call OnPaint function when you change a property of class
you can call Invalidate function
and Refresh it !
[Category("Image"),
         Description("Image for the Control" )]
        public Image Images
        {
            get { return _image; }
            set 
            { 
                _image = value; 
                if (this.Parent != null) 
                    Parent.Invalidate(this.Bounds, true);
                this.Refresh();
            }
        }

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Sepehr Shojaee
Software Developer (Senior)
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

Comments and Discussions

 
GeneralReason for my vote of 1 trivial (everyone painting controls ... Pinmemberjohannesnestler11-Aug-11 3:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 10 Aug 2011
Article Copyright 2011 by Sepehr Shojaee
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid