Click here to Skip to main content
12,759,636 members (32,297 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 10 Aug 2011

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

, 10 Aug 2011 CPOL
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 !
         Description("Image for the Control" )]
        public Image Images
            get { return _image; }
                _image = value; 
                if (this.Parent != null) 
                    Parent.Invalidate(this.Bounds, true);


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

You may also be interested in...


Comments and Discussions

GeneralReason for my vote of 1 trivial (everyone painting controls ... Pin
johannesnestler11-Aug-11 4:14
memberjohannesnestler11-Aug-11 4:14 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 10 Aug 2011
Article Copyright 2011 by Sepehr Shojaee
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid