Access Mdi Parents Variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • parkavi
    New Member
    • Mar 2007
    • 11

    #1

    Access Mdi Parents Variable

    hai all......

    i am new to vc++.Net..... i have a problem,thatz how can i access MDI Parent from child Form.... in Vb.Net there s a option "ADD module",in that i declare one public varible then i access that from all Forms including MDI Parent....but in VC++.Net,Only "Add class" option is there....

    plz help me............. .
    how to solve this problem........ ...............


    thanx in advance
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    (Ignore this, I didn't see the VC++ note. Although I think this question is better asked in the C/C++ forum since VC seems to be vastly different from the VB/C# implementation of .NET)
    I am not sure what you are asking, but every control (including Forms) have a .Parent that points to their parent control.

    Comment

    • nikpreek
      New Member
      • Jun 2007
      • 22

      #3
      Oops, my code is in C#

      Use this: (C#)

      MyMdiForm o = (MyMdiForm)this .ParentForm;
      o.ShowForm(send er);

      Here this is used for current child form.

      I think if u r using .NET (managed C++), just syntax will be different, but form class will have all its properties
      Last edited by nikpreek; Jun 19 '07, 01:26 PM. Reason: code in c#

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        I believe you can access this with the MdiParent property.

        Comment

        Working...