Mesran

Hanya ingin berbagi kebaikan dan mendapatkan kebaikan yang lain.

hmm Gimana ya MAU ENTER!

Sewaktu menjalankan program dan setelah kita mengisikan suatu nilai pada TextBox di ENTER kok nggak bisa yah? wkwkwkwkwkw, nah nih tipsnya🙂

Buatlah Event berikut ini🙂  (Saya memodifikasi program berikut ini https://mesran.wordpress.com/2011/10/16/pemakaian-if-pada-vb-net/)

Public Class Form1
    .......
    .......
    .......
    .......

    Private Sub Pembeli_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Pembeli.KeyPress

    End Sub

End Class

Bagaimana cara membuat event tersebut? lihat gambar berikut ini🙂

sudah nampak kan ?😀 ok ketikkan program berikut ini🙂

Public Class Form1

    .......
    .......
    .......
    .......

    Private Sub Pembeli_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Pembeli.KeyPress
        If e.KeyChar = Chr(13) Then
            Harga.Focus()
        End If
    End Sub

End Class

PENJELASAN
Event Keypress –> merupakan suatu event yang menangkap penekanan tombol tombol keyboard
chr(13) –> Merupakan Tombol ENTER
e.KeyChar –> merupakan variabel yang menyimpan penekanan tombol keyboard yang anda tekan

Hope you understand, ok! That’s very easy okay.
Just say ! I Love youuuu hahaha😀 :p

Filed under: VB2008Tips, VS2008, ,

Terima kasih telah memberikan komentar anda.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives Per Tahun

Sponsored

C&C Online Shop

Blog Stats

  • 355,907 sejak 12 Jan 2011

User’s Online


My Music

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 223 other followers

October 2011
M T W T F S S
« Sep   Nov »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
%d bloggers like this: