Rabu, 25 April 2012

Cara Menerapkan Code Ascii Enter pada Visual Basic 6

my-infortech.blogspot.com - Kali ini saya akan memberi tahu cara menerapkan code Ascii Enter pada Visual Basic 6 sekaligus menampilkan melalui message box dengan code yang sederhana.




Pertama buat form seperti pada gambar berikut :








Lalu copy code di bawah ini dan paste pada View Code atau tempat menulis script


Private Sub Command1_Click()
    MsgBox "Nama   : " + Text1.Text + vbCrLf + "Alamat : " + Text2.Text + vbCrLf + "Hobby  : " + Text3.Text, , ".::Warning...!!!"
End Sub


Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Text2.SetFocus
    End If
End Sub


Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Text3.SetFocus
    End If
End Sub


Private Sub Text3_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Command1.SetFocus
    End If
End Sub

0 komentar:

Posting Komentar