G
Guest
I have several user controls that have a few methods in common, such
LoadFromForm() which populates an object from controls on the form. I want
to call that method from the form in which the control is contained
regardless of the type currently displayed without having to use a huge
switch somthing like:
switch(curentUserType.GetType())
{
case "Person":
((person)currentUserControl).LoadFromForm();
....
case "Animal"
((animal)currentUserControl).LoadFromForm();
....
}
I assume there is something like:
((currentUserControl.GetType())currentUserControl).LoadFromForm();
available to call the LoadFromForm method regardless of the user control
type, but I can't figure out how to do it.
Thanks in advance for any help.
LoadFromForm() which populates an object from controls on the form. I want
to call that method from the form in which the control is contained
regardless of the type currently displayed without having to use a huge
switch somthing like:
switch(curentUserType.GetType())
{
case "Person":
((person)currentUserControl).LoadFromForm();
....
case "Animal"
((animal)currentUserControl).LoadFromForm();
....
}
I assume there is something like:
((currentUserControl.GetType())currentUserControl).LoadFromForm();
available to call the LoadFromForm method regardless of the user control
type, but I can't figure out how to do it.
Thanks in advance for any help.