Tutorial VB. Net 2005

0

Memulai Aplikasi VB.net dengan Login Password

Buatlah form seperti diatas lalu masukkan sintak seperti di bawah ini :

Public Class Form1

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

        If TextBox1.Text = “hafids” And TextBox2.Text = “test” Then

            Form1.ActiveForm.Hide()

            Dim form As New Form2

            Form2.Show()

        Else

            MessageBox.Show(“Password salah”, “Perhatian”)

            TextBox1.Text = “”

            TextBox2.Text = “”

            TextBox1.Focus()

        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        TextBox1.Text = “”

        TextBox2.Text = “”

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Close()

    End Sub

End Class

Jadi deh form loginnya,

Sedikit Semoga membantu …………………….

Iklan