If I override OnPaint and draw a square on the control, how do I get that e.graphics.draw... to show up when I'm previewing it in the designer?
http://msdn.microsoft.com/en-us/magazine/cc164048.aspx
http://msdn.microsoft.com/en-us/magazine/cc164145.aspx
While you could manually register with Control.OnPaint to add your design time UI, you'll find that overriding OnPaintAdornments is a better option because it is only called after the control's design-time/run-time UI is painted, letting you put the icing on the cake (see Figure 20). Simply adding DesignerAttribute to the ClockControl class completes the association: Copy Code
[ Designer(typeof(ClockControlDesigner)) ] class ClockControl : Control { ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With