04-17-2008 11:18 AM - edited 04-17-2008 11:21 AM
Private
Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F1 Then
Valve1_Switch_StateChanged(sender, e)
End IfWhen i did this with the button_click event it worked but when i do this with the switch i get this error when trying to build:
Value of type 'System.Windows.Forms.KeyEventArgs' cannot be converted to 'NationalInstruments.UI.ActionEventArgs'.
Is there any way around this?
Thanks,
BienoJ
04-17-2008 11:59 AM - edited 04-17-2008 11:59 AM
If e.KeyCode = Keys.F1 Then
Dim myArgs As ActionEventArgs = New ActionEventArgs(UI.Action.ByKeyboard)
Switch1_StateChanged(sender, myArgs)
End If
Best Regards,
04-17-2008 03:31 PM