i want to get keypress event in windows panel control in c#, is any body help for me...
"Panel" objects cannot receive the "KeyPress" event correctly.
I've created Panel
overload:
public class PersoPanel : Panel
and used the overridden method ProcessCmdKey
:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
to intercept pressed keys:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
MessageBox.Show("You press " + keyData.ToString());
// dO operations here...
return base.ProcessCmdKey(ref msg, keyData);
}