[Closed] How to use KeyUp event?
Hi! I have a problem about how to use KeyUp event.
I create a dotNet Label. And I want to detect the pressed state of the Shift, Ctrl and Alt keys. So how to do this? Use KeyUp or KeyDown or KeyPress event?
But there’s nothing happens.
on imgLab KeyDown arg do
show arg
So how can I do it?
check control’s modifierkeys property
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.modifierkeys.aspx
This is probably do to the fact that the label doesn’t have focus. If you try doing something like rolloutName.imgLab.focus() and then hit a key, then you should see the event show up.
As to how to give focus, that depends on what use you are giving o the label, one way would be to create a mouseDown event that gives focus to the label.