65.9K
CodeProject is changing. Read more.
Home

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

starIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

1.00/5 (1 vote)

Aug 10, 2011

CPOL
viewsIcon

11570

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();
            }
        }