Results 1 to 4 of 4

Thread: mdi - how do I use the same child forms all the time ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    2

    Question mdi - how do I use the same child forms all the time ?

    Hello All,

    New to the forum, been searching to find some MDI solutions, maybe have not been using the correct terms, writing a utility to use at the sound bench to update their website with new sound bytes and webpage.

    What I am trying to do is to use the same child forms all the time, instead of generating new ones each time a toolbar button is pressed. Would like to only cycle through the ones that I have already created (settings that only change, if they move to another ISP or want to change webpage layout, or change the directory structure on the local or remote drives).



    Thank you to anyone who can shed some light in this dark confused head

  2. #2
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245
    On application startup, load all of your forms, but don't display them. When a user wants to use a particular form then display it, and then when they're done with it just hide it rather than closing it.
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    2
    Been trying to do just that, only I keep getting new copies of the forms instead of the ones that are already there.

    I am a total newbie to this Visual Basic stuff, could you help with a code sample perhaps ?

    Thank you

  4. #4
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245
    You just need to declare object variables that represent your form. IE:

    VB Code:
    1. ' Assuming your child form is named frmChild....
    2. Dim ChildForm As New frmChild

    Then all you do is refer to the ChildForm variable when you want to display the form, instead of the form itself.

    VB Code:
    1. ChildForm.Show
    2.  
    3. ' Instead of frmChild.Show

    HTH
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

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