S
ShaneO
I would like to handle the KeyUp & KeyDown events in the same event
handler but can't find how to determine which event was fired -
Private Sub ListBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) _
Handles ListBox1.KeyUp, ListBox1.KeyDown
If e.KeyValue = Keys.PageDown Or e.KeyValue = Keys.PageUp Or e.KeyValue
= Keys.End Or e.KeyValue = Keys.Home Then
'If User "Pressed" key (KeyDown) then do something...
'If User "Released" key (KeyUp) then do something else...
End If
End Sub
Apart from duplicating the code in the individual KeyUp and KeyDown
Events, does anyone know how to determine which action triggered the
event handler in this case?
ShaneO
There are 10 kinds of people - Those who understand Binary and those who
don't.
handler but can't find how to determine which event was fired -
Private Sub ListBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) _
Handles ListBox1.KeyUp, ListBox1.KeyDown
If e.KeyValue = Keys.PageDown Or e.KeyValue = Keys.PageUp Or e.KeyValue
= Keys.End Or e.KeyValue = Keys.Home Then
'If User "Pressed" key (KeyDown) then do something...
'If User "Released" key (KeyUp) then do something else...
End If
End Sub
Apart from duplicating the code in the individual KeyUp and KeyDown
Events, does anyone know how to determine which action triggered the
event handler in this case?
ShaneO
There are 10 kinds of people - Those who understand Binary and those who
don't.