Öncelikle Selamun Aleyküm tuş atama ile ilgili baya bi video izledim ama hepsi buttona kodluyor bende checkboxa kodlamak istiyorum always yapıcam yardımcı olucak varmı ya
Öncelikle formuna bir timer ekle ve interval ini 1 yap.
Şimdi ise fonksiyonu formumuza yerleştirelim.Bunu Public Class Form1'in altına yaz.
Visual Basic:
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Bunu da Timer'in tick eventine koy(timer e 2 kere tıkla ve bunu yaz)
Visual Basic:
If GetAsyncKeyState(Keys.Delete) Then
//keys.delete yerine istediğin tuşu yaz ve bu kısma da tuşa basılınca ne olacağını yaz.
End If
Kısaca:
Visual Basic:
Public Class Form1
Dim degis As Integer
Dim input As String
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.Delete) Then
CheckBox1.Checked = True
End If
End Sub
Burdaki kodlarda Sen Delete tuşuna basınca CheckBox Checked oluyor. Eğer Sen checkbox u elinle checked yapıp tuş sistemini aktif etmek istersen aynı kodları timersiz kullan. İyi Forumlar