Calling function of ChildForm from MDIForm

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ksharma
    New Member
    • Sep 2007
    • 1

    Calling function of ChildForm from MDIForm

    Hi,

    I m new in c#, windows application.

    I have created a MDIForm, ChildForms named (Form1, Form2, Form3, ..........).
    Each child form contains the function :

    public void Enable_Disable_ GU(bool p_status)
    {
    textBox1.Enable d = p_status;
    textBox2.Enable d = p_status;
    textBox3.Enable d = p_status;
    }

    MDIForm contains a button : btn1. At click event of btn1, i have to call the above function for CURRENT ACTIVE FORM
    eg -
    ActiveMdiChild. Enable_Disable_ GU(false);

    I m unable to call the function.

    Please help me.

    Thanks

    Kamal
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Suggest try searching the site, this type of problem has come up before.

    Comment

    • jigsmshah
      New Member
      • Aug 2007
      • 14

      #3
      if u r getting the reference of the child form ,then try to cast the reference to
      respective class.and then see if ur getting the function u want to invoke

      Comment

      Working...