Results 1 to 9 of 9

Thread: [RESOLVED]child forms and main forms....?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156

    Question [RESOLVED]child forms and main forms....?

    Hey folks,

    so thats it I decided to move to VB.net, and currently im looking its feuters, seems nice BTW.


    And to my question:
    I created main form called frmMain and 3 severl forms frm1, frm2 and frm3.
    On the main form i created 3 buttons which each one of them should open sec forms, now the question is cani use the forms like we used in VB6 thing calles group box?
    what i need is to load forms onto the main form, can i, and how?
    Last edited by ArChAnGeL2k3; Feb 28th, 2004 at 04:42 PM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Definitely , you need to read more about how VB.NET differe from VB6 . To show the other forms from Main Form do this :

    VB Code:
    1. Dim frm1 As New Form1
    2. frm1.Show

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156
    Well it isnt that simply, i mean to show other forms inside the main, like i said i got 4 forms, 3 simple forms, and one "Main",
    i need to load into the main form, the other 3 like labels and syuff...
    if u dont understand what i mean ill explain better with pictures.

    thx for help.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by ArChAnGeL2k3
    Well it isnt that simply, i mean to show other forms inside the main, like i said i got 4 forms, 3 simple forms, and one "Main",
    i need to load into the main form, the other 3 like labels and syuff...
    if u dont understand what i mean ill explain better with pictures.
    You mean , MDI forms . If no , then I don't follow . I'd better to show some pictures if you have .

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156
    okokokok, thats it, im going to explain now:

    i created a multiple forms project.
    and one form that used to be the main formwith the menu that connects all the other forms.
    now till now i used to show and hide different forms one after the other, now i want to use my main form which has horizontal menu like my main form and all the other form swill load into him, and not insted him.
    and yes i think it called mdi chiled.


    thx for helping.

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Here's a demo . Give it a look .
    Attached Files Attached Files

  7. #7
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    If you have come from VB6, you will be fully aware of Parent/Child forms. There are some differences in .NET, all of which are advantageous.

    You can, either in code or at design time,:

    Set the MDIContainer property of form1 to True.
    Set the MDIParent property of forms2 etc to form1. (Use "Me" if using code and referencing from form1)
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156
    thx guyus i manged to do it, only thing now is to determin the size and position of the child on the parent form,
    thx alot guys!




    urs ACAGL

  9. #9
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    download and try this

    This is an extension of System.Windows.Forms.Form. you just inherit from Ezekiel.Windows.Forms.FormEx and construct your form with a key and you have a global ref to your form in Ezekiel.Windows.Forms.FormEx.Forms[key/index].......

    Just run the exe and read the c# code code. sorry I don't really know VB.Net anymore. If some on asks I'll make a vb sample project. Put it's simple to use this.

    This works perfectly and it's just like back in vb6 except your form is only global when you consruct it using a key.....
    VB Code:
    1. Dim frm As FormEx = New FormEx("frm")
    Attached Files Attached Files
    Magiaus

    If I helped give me some points.

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