Catching Ctrl + Click on a checkbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to identify when the Ctrl Key is down whilst clicking on a
checkbox on a windows form?
I have a checkbox on a User Control on a Tab on a windows form.
 
Write an override for the OnKeyDown and OnKeyUp methods, and set a boolean
variable indicating if the Ctrl key is currently depressed.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
I tried this on the main form, on the panel on the tab control on form and on
the checkbox control itself with out any luck firing these functions. Also
trapping the KeyDown events.
 
Hi Boon,
In any of the mouse events or the Click event you can check the ModiferKeys
that will give you the state of the Contol, Shift and Alt key when the event
happened.

ModiferKeys is static property of the Control class so it is available in
any winforms control.

HTH
 
Thank you very much.
Exactly what I needed

Stoitcho Goutsev (100) said:
Hi Boon,
In any of the mouse events or the Click event you can check the ModiferKeys
that will give you the state of the Contol, Shift and Alt key when the event
happened.

ModiferKeys is static property of the Control class so it is available in
any winforms control.

HTH
 
Back
Top