View Full Version : How to use KeyUp event?
Jausn 12-26-2009, 03:08 AM 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?
|
|
MarcoBrunetta
12-26-2009, 02:24 PM
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.
denisT
12-26-2009, 08:14 PM
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
CGTalk Moderation
12-26-2009, 08:14 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.