Hello:
I have a Class that adds Event Controls to all my Forms.
Now I would like to add a Control for the Form on other Events. Below is the code I have now.
How do I set up the Control for the Form at Load or other events?
Control TheControl = TheForm.GetNextControl(null, true);
while (TheControl != null)
{
TheEvent = TheControl.GetType().Name;
switch (TheEvent)
{
case "Button":
TheControl.Enter += new EventHandler(ButtonEnter);
TheControl.Leave += new EventHandler(ButtonLeave);
TheControl.MouseHover += new EventHandler(TextBoxMouseHover);
TheControl.MouseLeave += new EventHandler(TextBoxMouseLeave);
break;
case "CheckBox":
...
Loading
PJ MartinsPosted May 26, 2010, 6:26 PM
case "Form":
((Form)TheControl).Load += new EventHandler(FormLoad);
((Form)TheControl).Shown += new EventHandler(FormShown);
etc...