dvplayltd
asked on
Call function in different child forms from MDI form with C#
Hi expert !
Im new in C# and need help. With NET Framework 2.0 and C# 2008 i need to make MDIform and many child forms with different textboxes and buttons and so on. I need to make buttons in MDI form and when click on this buttons to call function in child forms. If child form have not this function in it will not do nothing.
I try
this.ActivateMdiChild(acti veForm);
activeForm.aaaa();
but when compile have error which tell that function aaaa() doesnt exsist. How to avoid this befaour? May be with Reflection ?
Note: till now I reach to follow code which work
foreach (Form frm in this.MdiChildren)
if (frm is frmRequestAd)
{
frmRequestAd f = frm as frmRequestAd; f.aaaa(); break;
}
}
, but I will have many chid form and many buttons and when add new child form I will need on EVERY button to add such text &
Im new in C# and need help. With NET Framework 2.0 and C# 2008 i need to make MDIform and many child forms with different textboxes and buttons and so on. I need to make buttons in MDI form and when click on this buttons to call function in child forms. If child form have not this function in it will not do nothing.
I try
this.ActivateMdiChild(acti
activeForm.aaaa();
but when compile have error which tell that function aaaa() doesnt exsist. How to avoid this befaour? May be with Reflection ?
Note: till now I reach to follow code which work
foreach (Form frm in this.MdiChildren)
if (frm is frmRequestAd)
{
frmRequestAd f = frm as frmRequestAd; f.aaaa(); break;
}
}
, but I will have many chid form and many buttons and when add new child form I will need on EVERY button to add such text &
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window