Sabtu, 02 April 2011

coding vb.net



Coding VB.NET

Public Class frmPassword
    Private Sub txtNama_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtNama.KeyPress
        If e.KeyChar = Chr(13) Then
            Me.txtPassword.Focus()
        End If
    End Sub
    Private Sub txtPassword_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPassword.KeyPress
        If e.KeyChar = Chr(13) Then
            Me.btnOK.PerformClick()

        End If
    End Sub
    Private Sub bersin()
        Me.txtNama.Clear()
        Me.txtPassword.Clear()
        Me.txtNama.Clear()
    End Sub
    Private Sub btnBatal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBatal.Click
        bersin()
    End Sub
    Private Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If Me.txtNama.Text = "Praktikan" And Me.txtPassword.Text = "Gunadarma" Then
            MsgBox("Anda User, silahkan Log In", MsgBoxStyle.OkOnly)
        Else
            MsgBox("Maaf,anda tidak bisa Log In ")
        End If
    End Sub
    Private Sub btnKeluar_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKeluar.Click
        If Me.txtNama.Text = "Praktikan" And Me.txtPassword.Text = "Gunadarma" Then
            MsgBox("Anda User, stop Aplikasi", MsgBoxStyle.OkOnly)
        Else
            MsgBox("Maaf, Aplikasi tidak dapat di stop")
        End If
    End Sub









Tidak ada komentar:

Posting Komentar