|
-
Nov 6th, 2009, 06:41 AM
#8
Thread Starter
Member
Re: Cant figure out how to use keys, any ideas?
I placed that into my form like below but it didn't work but it works in a new form on its own no problem.
vb code:
Public Class Form1
Private Declare Function OpenDevice Lib "k8055d.dll" (ByVal CardAddress As Integer) As Integer
Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
Private Declare Sub ClearDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
' Public up, down, lleft, rright As Boolean 'to keep track of which buttons are already pressed
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim CardAddress As Integer
Dim h As Integer
CardAddress = 3
h = OpenDevice(3)
Label1.Text = "Card " + Str(h) + " connected"
End Sub
Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
MsgBox(e.KeyCode)
MyBase.OnKeyDown(e)
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|