Simple Login Form

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
1 post Page 1 of 1
Contributors
User avatar
MrAlicard
VIP - Donator
VIP - Donator
Posts: 54
Joined: Thu Aug 05, 2010 4:08 pm

Simple Login Form
MrAlicard
Simple Login Form.

Include:
  • 2 TextBox
    2 Button
    2 Label
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "Username" And TextBox2.Text = "Password" Then
            MsgBox("Welcome Guest")
            Using Form2 As New Form2
                Hide()
                Form2.ShowDialog()
                Show()
            End Using
        Else
            MsgBox("Login failed!")
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub
or
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "Username" And TextBox2.Text = "Password" Then
            MsgBox("Welcome Guest")
            Form2.Show()
        Else
            MsgBox("Login failed!")
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub
Second possibility is according you need to set: My Project--->ShutDown Mode---->When last form closes .

Video ( but the video language: Hungarian)
1 post Page 1 of 1
Return to “Tutorials”