I have a usercontrol that is used to show its parent form using some effects.
i want this usercontrol to detect when Form.Show() is called and take over from there.
is there any simple way to do that except from subclassing?
Printable View
I have a usercontrol that is used to show its parent form using some effects.
i want this usercontrol to detect when Form.Show() is called and take over from there.
is there any simple way to do that except from subclassing?
Here is what you have available to work with.
Quote:
The Initialize event occurs every time an instance of your control is created or re-created. It is always the first event in a control instance's lifetime.
The InitProperties event occurs only in a control instance's first incarnation, when an instance of the control is placed on a form. In this event, you set the initial values of the control's properties.
The ReadProperties event occurs the second time a control instance is created, and on all subsequent re-creations. In this event, you retrieve the control instance's property values from the in-memory copy of the .frm file belonging to the form the control was placed on.
The Resize event occurs every time a control instance is re-created, and every time it is resized — whether in design mode, by the developer of a form, or at run time, in code. If your UserControl object contains constituent controls, you arrange them in the event procedure for this event, thus providing your control's appearance.
The Paint event occurs whenever the container tells the control to draw itself. This can occur at any time, even before the control receives its Show event — for example, if a hidden form prints itself. For user-drawn controls, the Paint event is where you draw your control's appearance.
The WriteProperties event occurs when a design-time instance of your control is being destroyed, if at least one property value has changed. In this event, you save all the property values a developer has set for the control instance. The values are written to the in-memory copy of the .frm file.
The Terminate event occurs when the control is about to be destroyed.
Thank you :)