Sorcode
Public Class
Form1
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button1.Click
If TxtPassword.Text = ""
And TxtUsername.Text = ""
Then
MessageBox.Show("Username dan Password
harus di isi", "Konfirmasi",
MessageBoxButtons.OK, MessageBoxIcon.Question)
TxtUsername.Focus()
ElseIf TxtPassword.Text = ""
Then
MessageBox.Show("Password harus di
isi", "Konfirmasi",
MessageBoxButtons.OK, MessageBoxIcon.Question)
TxtPassword.Focus()
ElseIf TxtUsername.Text = ""
Then
MessageBox.Show("Username harus di isi", "Konfirmasi", MessageBoxButtons.OK,
MessageBoxIcon.Question)
TxtUsername.Focus()
ElseIf
TxtUsername.Text = "Data" And TxtPassword.Text = "Data"
Then
MessageBox.Show("Password dan Username Benar", "Konfirmasi", MessageBoxButtons.OK,
MessageBoxIcon.Question)
Else
MessageBox.Show("Password dan Username Salah", "Konfirmsi", MessageBoxButtons.OK,
MessageBoxIcon.Question)
TxtUsername.Text = ""
TxtPassword.Text = ""
TxtUsername.Focus()
End If
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Close()
End Sub
End Class
0 Comments