Control Instantiation
-
Lets say I have a visual control with several properties set during design that will affect the display of the control. How do I ensure that the control is repainted after the properties are set in InitializeComponent? Is there a way to determine the order that the control's properties are initialized in InitializeComponent so that I can ensure that the last initialization causes a repaint? Or is there an event that I can overrride that fires when the initialization is complete?
-
Lets say I have a visual control with several properties set during design that will affect the display of the control. How do I ensure that the control is repainted after the properties are set in InitializeComponent? Is there a way to determine the order that the control's properties are initialized in InitializeComponent so that I can ensure that the last initialization causes a repaint? Or is there an event that I can overrride that fires when the initialization is complete?
terrier_jack wrote: How do I ensure that the control is repainted after the properties are set in InitializeComponent? I believe that is the purpose of the ISupportInitialize interface--it lets other things do all the property setup, then when the EndInit() method is called, your class can do whatever it needs to configure itself based on those property values. Marc MyXaml Advanced Unit Testing YAPO
-
Lets say I have a visual control with several properties set during design that will affect the display of the control. How do I ensure that the control is repainted after the properties are set in InitializeComponent? Is there a way to determine the order that the control's properties are initialized in InitializeComponent so that I can ensure that the last initialization causes a repaint? Or is there an event that I can overrride that fires when the initialization is complete?
Why can't you do as this:
Public MyControl() { InitializeComponents(); this.refresh(); }
As it will be refreshed after the call of the init() is returned and all the initialization is complete. Assuming that your visual properties will be user in the Overrode OnPaint Method .