ss7thirty
Well-known member
I am pretty familiar with eventargs and have designed a few of my own recently (and I am proud of my work because it took forever). However I have a very basic question. I was looking through the posts and saw someone asking about the alt key pressed stuff and was trying to write something up and for some reason the form is just not catching the any key strokes at all here is what I have in there was trying to catch ALT + 3 but no such luck inserting breakpoints and catching any keys at the moment never have really dealt much with the keyevent args so do not know exactly what control or form or whatever catches them so I dont know what to put after the handles. so here is the snippet:
PrivateSub keypressed(ByVal sender AsObject, ByVal e As _ System.Windows.Forms.KeyPressEventArgs) HandlesMe.keypress
EndSub
Private _AltDown AsBoolean = False
Property AltDown() AsBoolean
Get
Return _AltDown
EndGet
Set(ByVal value AsBoolean)
_AltDown = value
EndSet
EndProperty
PrivateSub keydown_(ByVal sender AsObject, ByVal e As _ System.Windows.Forms.KeyEventArgs) HandlesMyBase.KeyDown
If e.Alt Then
Me.AltDown = True
Else
IfMe.AltDown Then
MsgBox(e.KeyData.ToString)
MsgBox(e.KeyCode.ToString)
MsgBox(e.KeyValue.ToString)
EndIf
EndIf
EndSub
naturally I know the obvious things that are missing like setting it to false on keyup and a possible select case statement to handle various other combinations.
PrivateSub keypressed(ByVal sender AsObject, ByVal e As _ System.Windows.Forms.KeyPressEventArgs) HandlesMe.keypress
EndSub
Private _AltDown AsBoolean = False
Property AltDown() AsBoolean
Get
Return _AltDown
EndGet
Set(ByVal value AsBoolean)
_AltDown = value
EndSet
EndProperty
PrivateSub keydown_(ByVal sender AsObject, ByVal e As _ System.Windows.Forms.KeyEventArgs) HandlesMyBase.KeyDown
If e.Alt Then
Me.AltDown = True
Else
IfMe.AltDown Then
MsgBox(e.KeyData.ToString)
MsgBox(e.KeyCode.ToString)
MsgBox(e.KeyValue.ToString)
EndIf
EndIf
EndSub
naturally I know the obvious things that are missing like setting it to false on keyup and a possible select case statement to handle various other combinations.