我不能改变我的形式

时间:2014-11-18 13:54:16

标签: vb.net forms

我有很大的问题。我的VB.NET项目中有2个表单。表格的名称是Form1和Form2。我有一个带有此代码的按钮:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Me.Hide()
    Dim Login As New Form2
    Login.Show()
End Sub

现在,当我单击此按钮时,Form2将打开,但在3或4分钟后,Form1将再次打开。 我应该说Me.close()与Me.Hide()同样发生在我身上。

Public Class Form2

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim fff As New Form2
    fff.Close()
    Form3.Show()

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    MsgBox("Sorry", MsgBoxStyle.MsgBoxHelp, "Error")
End Sub

我需要帮助

1 个答案:

答案 0 :(得分:0)

试试这个

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Login As New Form2
Form2.Show()
Me.dispose()
End Sub

它应该解决问题