Loading Forms In VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jams Al

    Loading Forms In VB.NET

    I am new to VB.NET. I am trying to load a form (named switchboard)
    from within a form (named login). But its not working. Following is my
    code. What am I missing?

    Dim Frm As New Switchboard
    Frm.Show()

    Thanks in advance.
  • Claes Bergefall

    #2
    Re: Loading Forms In VB.NET

    That code should work just fine. See if you can reproduce the problem in a
    small sample and then post it here.

    /claes

    "Jams Al" <Jams060606@gma il.comwrote in message
    news:bb684295-4004-4e6c-8f0f-a4ba47b06bc9@c6 5g2000hsa.googl egroups.com...
    >I am new to VB.NET. I am trying to load a form (named switchboard)
    from within a form (named login). But its not working. Following is my
    code. What am I missing?
    >
    Dim Frm As New Switchboard
    Frm.Show()
    >
    Thanks in advance.

    Comment

    • Phill W.

      #3
      Re: Loading Forms In VB.NET

      Jams Al wrote:
      I am new to VB.NET. I am trying to load a form (named switchboard)
      from within a form (named login). But its not working.
      Define "not working"

      /What/ happens?
      What error do you get?
      Following is my code. What am I missing?
      Dim Frm As New Switchboard
      Frm.Show()
      Is your "login" dialog Modal, i.e. did you put it on screen with
      [login].ShowDialog()?

      It certainly /used/ to be the case that you /couldn't/ "Show" a Form
      from within one that you'd "ShowDialog 'd".

      HTH,
      Phill W.

      Comment

      • Lloyd Sheen

        #4
        Re: Loading Forms In VB.NET


        "Jams Al" <Jams060606@gma il.comwrote in message
        news:bb684295-4004-4e6c-8f0f-a4ba47b06bc9@c6 5g2000hsa.googl egroups.com...
        >I am new to VB.NET. I am trying to load a form (named switchboard)
        from within a form (named login). But its not working. Following is my
        code. What am I missing?
        >
        Dim Frm As New Switchboard
        Frm.Show()
        >
        Thanks in advance.
        What are your options set to???

        Set :
        Option Strict On
        Option Explicit On

        Then most likely you will find out your problem.

        LS

        Comment

        • Jams Al

          #5
          Re: Loading Forms In VB.NET

          Hey

          Thank you so much for your replies. I found out the problem.

          I was using the following code.

          Me.Dispose()
          Dim Frm As New Switchboard
          Frm.Show()

          When I commented me.dispose, it works fine. But I do want to dispose
          off the login form after loading switchboard. Where should I put this
          code. Any ideas?

          Thanks again.

          Comment

          • Jams Al

            #6
            Re: Loading Forms In VB.NET

            I change the switchboard form to mdiparent form. This is the first
            time I am using an mdi form.

            After entering the details in the login form, the mdi parent form is
            loaded. Then I want to dispose off the login form. Kindly advise.

            Thanks

            Comment

            Working...