On Thu, 22 Dec 2005 06:59:04 -0800, Sharon <Sh*****@newsgroups.nospam>
wrote:
Thanks for try Justin,
But when the CTRL key is pressed down --> the event is fired, but the A key
event is not firing the event because the CTRL key is still pressed.
I event changed the code to:
private void OnDataGridKeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if( e.Equals(Keys.A) )
{
if( e.Control ) // It never gets in here !!!
{
// Some code...
}
}
}
I hope there is a solution for that.
------
Thanks
Sharon
Try overriding the ProcessDialogKey event:
bool ProcessDialogKey(Keys keyData)
For Ctrl-A use
if (keyData == Keys.Control | Keys.A) ...
or else
switch (keyData) { case Keys.Control | Keys.A: ...
Return true if you have processed the key, otherwise return
base.ProcessDialogKey(keyData) to give the rest of the system access
to the keystrokes you are not handling.
rossum
--
The ultimate truth is that there is no ultimate truth