Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to link 2 forms in vb.net[emergency]

how to link 2 forms in vb.net[emergency]

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MJay
    wrote on last edited by
    #1

    let say i got 2 forms, form1 and form2, how i going to show form2 when i click one button in form1?? just like form2.show in vb6!! but i cant find that in vb.net!!

    C 1 Reply Last reply
    0
    • M MJay

      let say i got 2 forms, form1 and form2, how i going to show form2 when i click one button in form1?? just like form2.show in vb6!! but i cant find that in vb.net!!

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      In the button click event handler in form1 create (or obtain) an instance of form2. MyForm2.Show() or MyForm2.ShowDialog() depending on how you want it to work. --Colin Mackay--

      "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        In the button click event handler in form1 create (or obtain) an instance of form2. MyForm2.Show() or MyForm2.ShowDialog() depending on how you want it to work. --Colin Mackay--

        "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

        M Offline
        M Offline
        MJay
        wrote on last edited by
        #3

        thank you for replying me! but i dunno how to create an instance of form2 in form 1!!:(

        C U 2 Replies Last reply
        0
        • M MJay

          thank you for replying me! but i dunno how to create an instance of form2 in form 1!!:(

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Dim MyForm2 as Form2
          MyForm2 = New Form2()
          MyForm2.Show()

          [I'm not a VB/VB.NET programmer so I may have the syntax slightly wrong] --Colin Mackay--

          "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

          H 1 Reply Last reply
          0
          • C Colin Angus Mackay

            Dim MyForm2 as Form2
            MyForm2 = New Form2()
            MyForm2.Show()

            [I'm not a VB/VB.NET programmer so I may have the syntax slightly wrong] --Colin Mackay--

            "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

            H Offline
            H Offline
            hyph3n
            wrote on last edited by
            #5

            Dim frm As New Form2() frm.ShowDialog()

            1 Reply Last reply
            0
            • M MJay

              thank you for replying me! but i dunno how to create an instance of form2 in form 1!!:(

              U Offline
              U Offline
              User 688482
              wrote on last edited by
              #6

              Say if you want to display form1 from form2. In the form2 create the instance of form1 - dim frm1 as new form1() and then frm1.show or frm1.showdialog will display the form - Sunil

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups