Join the forum, it's quick and easy

Would you like to react to this message? Create an account in a few clicks or log in to continue.

    Tips Untuk TextBox

    eRGe@N5
    eRGe@N5
    Member Newbie
    Member Newbie


    Male
    Thread & Post : 14
    Point Forum : 478933
    Thanks Given : 0
    Join date : 02.08.11
    Age : 34
    Lokasi : N3 & N5

    Tips Untuk TextBox Empty Tips Untuk TextBox

    Post by eRGe@N5 Thu Aug 18, 2011 1:58 am

    yang perlu dingat adalah event ini terjadi saat user ato pengguna menekan tombol keyboard atau yang lebih tepat nya pada event Keypress(KeyAscii as integer). nah untuk mengizinkan user hanya menginput berupa angka (number) codding nya seperti dibawah ini




    Option Explicit

    Const vbKeyDecPt = 46

    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii = vbKeyDecPt Or KeyAscii = vbKeyBack Then Exit Sub Else KeyAscii = 0 End If End Sub

    Untuk Menampilkan semua huruf Kapital (Huruf besar) pada textbox walaupun tombol Caps lock pada keyboard tidak di pencet codding seperti dibawah ini


    Private Sub Text1_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End Sub


    Event ini tidak akan berjalan kalo codding nya tidak ditempatkan pada event KeyPress(KeyAscii As Integer).


      Waktu sekarang Sun May 19, 2024 6:47 am