Can anyone tell me how to get the inkey like in basic but in vb. Like i have a list and everytime the user presses a key it adds it to the list!!??
Thanx
Printable View
Can anyone tell me how to get the inkey like in basic but in vb. Like i have a list and everytime the user presses a key it adds it to the list!!??
Thanx
Use the KeyDown or KeyAscii events of your Form. This example will add whatever key you pressed to a ListBox.
Code:Private Sub Form_KeyPress(KeyAscii As Integer)
'Add the character to the ListBox
List1.AddItem (Chr(KeyAscii))
End Sub
Private Sub Form_Load()
'The Form will recieve the keys before the Controls
Me.KeyPreview = True
End Sub
i mean when the form is invisible and the user types a letter and the program records it so if im on the internet and i happen to type the word "worth" if i look at the archive it saves the letters in I'll se "worth" somewhere in there!!!!!!
Use the GetAsyncKeyState API. I explaied how to use this in your other post regarding this subject.
Click here to view it