Results 1 to 3 of 3

Thread: Loading an MDI form from Sub Main()

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    Manchester, UK
    Posts
    16

    Loading an MDI form from Sub Main()

    I've just started playing with VB.NET and thought I would start with opening an MDI form.
    My app starts from a Sub Main() and I used the FormName.Show() call to open the MDI form but the MDI form open and closes itself straight away (unlike VB6).
    I even built a VB6 app that just opens an MDI from a Sub Main() and converted it to .NET and it did just the same.
    How do I stop the MDI form from closing itself as soon as it's loaded.

    Cheers,
    Mark.

  2. #2
    Lively Member adsc's Avatar
    Join Date
    Nov 2002
    Location
    Kuwait
    Posts
    71
    Hi,

    You have to use the instance name of the form as follow:

    Dim MainMenu As New Form1()
    Application.Run(MainMenu)
    <><><><><><><><><><><><><><><><><><>
    <><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
    <><><><><><><><><><><><><><><><><><>

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    Manchester, UK
    Posts
    16
    Thanks

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