Visual_Basic küçük bi soru :D
11
●1.945
- 30-09-2007, 21:50:45toplanacak olan ilk sayıya text1 ikinci sayıya text2 diyelim.
formumuza iki adet txtbox ekledikten sonra
textboxların KeyDown olaylarına aşağıdaki kodları ekle.
burada keycode = 107 + tuşunun tuş kodu kodu keycode = 13 enter tuşunun key kodudur.
SendKeys "{TAB}" ise enter tuşuna basıldıysa send tuşuna basıldı saymaktır.
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 107 Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{TAB}"
MsgBox Val(Text1) + Val(Text2)
End If
End Sub
eğer başka bi tuşun keycode si lazım ise
msgbox keycode
komutunu herhangi bi textbox un KeyDown olayına yazarsan text seçili iken basılan tuşun keycode sini mesajbox olarak sana geri döndürür.
umarım açıklayıcı olmuştur ve işine yarar.