Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a custom label control with a custom property bordercolor.
in de property window of VS2010 you can change the bordercolor of the label
The custom label overrides the onPaint event

VB
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

     MyBase.OnPaint(e)

     ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, _BorderColor, 1, _
         ButtonBorderStyle.Solid, _BorderColor, 1, ButtonBorderStyle.Solid, _BorderColor, 1, _
         ButtonBorderStyle.Solid, _BorderColor, 1, ButtonBorderStyle.Solid)

 End Sub


If a change the bordercolor VS2010 does not immidiatly change the color on the form like the standard backcolor property of the label. I first have to click on the form to see the change i've made.

How can i see the changes immidiatly in design mode in VS2010
Posted
Updated 10-Jul-13 3:39am
v3

In the custom property setter, call the Invalidate() method on the control.
 
Share this answer
 
For designTime you have to rebuild the control to refresh it in the designer.
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900