Yang Pertama harus dilakukan dalam dasar control button pada Vb.Net.
1. Bukalah Vb.Net kalian kemudian pilih Create a New Project.
2. Setelah itu pilih Windows Forms App (.NET Framework), klik next.
3. Muncul gambar seperti dibawah lalu setting sesuai keinginan kalian, klik Create.
Berikut pencodingan :
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.KeyPreview = True
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
MsgBox("button 1")
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
MsgBox("button 2")
End Sub
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F5 Then
Button1.PerformClick()
ElseIf e.KeyCode = Keys.f6 Then
Button2.PerformClick()
End If
End Sub
End Class
*Begitu saja tutorial Dasar Control Button pada Vb.Net.......
0 Komentar