Jumat, 09 Januari 2015

[Tugas Pemrograman Visual] Membuat Form Login Pada VB.Net

Kagak pake basa-basi, Gan. Mari kita sikat ilmu dari saya yang tak seberapa ini.

 Sing iki listing programe yoo...



Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Value = ProgressBar1.Value + 1
        If ProgressBar1.Value = 100 Then
            Timer1.Stop()
            Form1.Show()
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Username.Text = "Igaph" And Password.Text = "1234" Then
            Timer1.Start()
        Else
            MsgBox("Username dan password Anda Salah")
            Username.Text = ""
            Password.Text = ""
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim q As Integer
        q = MsgBox("Apakah Anda ingin Keluar ?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Absensi Karyawan")
        If q = vbYes Then
            Close()
        End If
    End Sub

    Private Sub Password_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Password.KeyPress
        Dim t As Integer = Asc(e.KeyChar)
        If t = 13 Then
            If Username.Text = "Sari" And Password.Text = "1234" Then
                Timer1.Start()
            Else
                MsgBox("Username dan password Anda Salah")
                Username.Text = ""
                Password.Text = ""
            End If
        End If
    End Sub


 Ketika kita klik button Logoff maka akan muncul kotak dialog seperti ini:

Selamat menikmati ilmu yang diperoleh.



Subscribe to Our Blog Updates!




Share this article!

Tidak ada komentar:

Posting Komentar

Return to top of page
Powered By Blogger | Design by Genesis Awesome | Blogger Template by Lord HTML