Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Visual Basic HELP (http://www.go4expert.com/forums/visual-basic-help-t9560/)

Callme 23Mar2008 22:59

Visual Basic HELP
 
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.

jin29_neci 13May2008 08:17

Re: Visual Basic HELP
 
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



All times are GMT +5.5. The time now is 19:56.