Visual Basic HELP

Discussion in 'Visual Basic ( VB )' started by Callme, Mar 23, 2008.

  1. Callme

    Callme New Member

    Joined:
    Mar 23, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I use VB 2008 Express Edition, and I cannot get my multiple form application to work correctly. I am trying to get frmNext to show up after frmInput is done. So, in frmInput's button click event, I type in strName = TextBox1.Text, frmNext.Show(), and Unload frmInput. Unload does not work in vb 2008 anymore I guess, because it gave me an error. So, I typed in Me.Close(), which closes the application altogether. So, I decided to go into frmNext's form load event and type in Me.Text = strName and frmInput.Close(), which causes the entire program to close. I need help getting frmNext to show up and frmInput to close down.
     
  2. jin29_neci

    jin29_neci New Member

    Joined:
    May 8, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim strX As String
            strX = TextBox1.Text
            Me.Hide()
            Form2.Show()
        End Sub
    End Class
    
    Public Class Form2
    
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.Text = Form1.TextBox1.Text
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Application.Exit()
        End Sub
    End Class
    
    
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice