0

Hi guys,

Im learning VB.NET and as a first task im creating a login form. ive been trying to link it to another form once a correct username and password are entered. however, despite that i still cant be able to hide it or unload it once the next form is loaded

Here is the Code

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        If UsernameTextBox.Text = "chris" And PasswordTextBox.Text = "chrispass" Then
            Me.Hide()
            Form2.Show()

        End If

        Me.Close()
    End Sub

The Form2 appears as coded above but the 'Me.Hide()' manages to hide the login form but then it appears again

Some input pls?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by chris evans
0

No problem here having a New Project with 2 Forms and using this code.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Hide()
        Form2.Show()
    End Sub
End Class

Form1 hides and Form2 shows, nothing else.

0

i've just tried that but it doesnt work - the form closes but appears again

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.