- Mengetahui Kode Ascii pada VB6
1. Tambahkan Form
2. Tambahkan textbox
3. Tuliskan source code sbb
Private Sub Form_Load()
Text1.Enabled = False
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Text1 = KeyAscii
End Sub
4. Jalankan Form lalu tekan tombol keyboard maka kode ascii akan tampil pada textbox (Text1)
- Penggunaan Tombol F1 ~ F12
1. Tambahkan commandbutton pada form
atur properties, caption = F2
2. Klik Form ,lalu atur properties
Key Preview = True
3. Masukkan source code
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
msgbox “Berhasil”
End If
End Sub
4. Jalankan Form lalu tekan F2 maka akan muncul pesan “Berhasil”
- Huruf Besar Pada Textbox
1. Tambahkan textbox pada form
2. kode
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
- Validasi Untuk angka
Biasanya dipakai untuk harga atau yang menggunakan angka saja.
Private Sub Text3_KeyPress(KeyAscii As Integer)
strangka = “0123456789”
If KeyAscii > 26 Then
If InStr(strangka, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
- UNTUK MENGETAHUI JUMLAH BARIS
- MENAMPILKAN DATA QTY dan HARGA dan TOTAL HARGA
ayo mbak posting tentang pemrograman web dg dreamweaber MX
di tunggu lho ya 🙂
ya bsk kalau dah dpt ilmune tak posting