CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: shared main

  1. #1
    Join Date
    Feb 2005
    Posts
    41

    shared main

    Hello,
    I have tabcontrol over main form, and I am creating and adding child forms to it. I wish to remove the tab, when child form unloads. However in .net 2003,
    frmMain.myTab...... like syntax isn't valid (OOP). I think I should make the mainForm as shared/global? How to do that? I'll appreciate any help.

  2. #2
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: shared main

    I think I should make the mainForm as shared/global?
    No - it will be enough if U make tab control as shared.

    But better make shared method (in main form).

    And even better if U create an event and subscribe to it from mainform.

    U can also create a form which will be the base form of all your child forms. Than U can make all common coding here.

    Best regards,
    Krzemo.

  3. #3
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: shared main

    When you guys say "shared", you mean either PUBLIC or FRIEND scope and not SHARED right?

    Krzemo is right, the proper way is to expose either METHOD or EVENT to do what you want to do.
    Good Luck,
    -Cool Bizs

  4. #4
    Join Date
    Feb 2005
    Posts
    41

    Re: shared main

    Sorry for my lack of understanding of VB .net. I still could not work it out. By making TabCOntrol1 of main control 'public', it can be accessed from other forms, but I wish to access TabCOntrol1 of SAME INSTANCE of the main form, not creating it again and then accessing its controls.

    Any code will be helpful. I know, it'll be very short . Just use of some right word at right place. [for example to solve this: I have a main form, over which I have a Tab control with two tab pages. How to delete second tab page from other form, Form2]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured