Menu

#6 Key Event never fires

v1.0_(example)
open
nobody
5
2006-01-11
2006-01-11
kevini
No

The control's Key event never fires. The fix is below:
The section under the "Raise Keypress event" was what
was added. The event should be raised whenever a key
is hit.

public override bool PreProcessMessage(ref Message m)
{
switch( m.Msg )
{
case WM_KEYDOWN:
{
if( ignoredKeys.ContainsKey( (int)
Control.ModifierKeys+(int)m.WParam) )
return base.PreProcessMessage(ref m );

// Raise Keypress event to parent
Key(this, (int)m.WParam, (int)
Control.ModifierKeys);
}
break;
}
return false;
}

Discussion


Log in to post a comment.