M
Marius Horak
ProcessKeyPreview in a UserControl works fine to intercept most of the
keys. But I would like to suppress some keys.
private Keys keyMultiply = Keys.Multiply;
.....
.....
protected override bool ProcessKeyPreview(ref
System.Windows.Forms.Message msg)
{
if (msg.Msg == WM_KEYDOWN)
{
if ((Int32)msg.WParam == (Int32)_keyPrintOrder)
{
MessageBox.Show("*");
return true;
}
}
return base.ProcessKeyPreview(ref msg);
}
When the active control is for example a textbox * will get to it
before MessageBox.Show is being shown. How come? How to suppress keys
in UserControl?
Thanks
MH
keys. But I would like to suppress some keys.
private Keys keyMultiply = Keys.Multiply;
.....
.....
protected override bool ProcessKeyPreview(ref
System.Windows.Forms.Message msg)
{
if (msg.Msg == WM_KEYDOWN)
{
if ((Int32)msg.WParam == (Int32)_keyPrintOrder)
{
MessageBox.Show("*");
return true;
}
}
return base.ProcessKeyPreview(ref msg);
}
When the active control is for example a textbox * will get to it
before MessageBox.Show is being shown. How come? How to suppress keys
in UserControl?
Thanks
MH