Results 1 to 4 of 4

Thread: loading a form

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    2

    loading a form

    i am not used to VB net because i have been using VB6 for awhile. I have a project with 2 forms in it. i unloaded the first form using the code

    Me.Unload

    but i am stuck on loading the second form. i tried things like show, load and run etc.. i am kind of stuck unless there is something stupid i am missing. thanks for your help.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224
    HI,

    Dim f2 As New Form2
    f2.Show()

    Have a nice day

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Load your forms from a Module. Use Sub Main()

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

    To clarify the previous responses.

    In the Module :

    VB Code:
    1. Dim frm1 As New Form1   (if you want to access one form from
    2.                                          another declare them both as  PUBLIC)
    3. Dim frm2 As New Form2
    4.  
    5.  
    6. Public Sub Main()
    7.         frm1.ShowDialog()
    8.         frm2.ShowDialog()
    9. End Sub

    If you use Application.Run(frm1) or if you set Form1 as the startup object, the application will terminate when F
    orm1 (or frm1) is closed.


    Before you go any further I suggest that you read the MSDN Helf files on Inheritance and Classes.
    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.

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