Hi,
Does anyone know how to pass a form as a parameter objectto a function call in a new instantiated class,called from that same form?
For example:
I'm in a form, it has a menu, I click on it, it instantiates a class
e.g. (clsFormLauncher cFL = new clsFormLauncher();)
thenI, say,call the class' function with a parameter of the form
e.g. cFL.Constituent_Card_Open(this);
The reason for this is I want to be able to reference the form in the function,to be able to use it as the MdiParent reference when I open another form from within the class object.
I don't know how to create a function with a parameter that takes a form object:
public void Constituent_Card_Open(System.Windows.Forms fForm)
{
fConstituent fC = new fConstituent();
fC.MdiParent =
fForm;
fC.Show();
}
Any ideas?
Many thanks,
Tim