How to grab input keys (Tab, Cursors Keys) in a control
C#, Component Development February 27th, 2006As default, systems keys such as tab, return, up, down, left and right are handled by the form to move between controls. To enable theses keys to be raised as key down, up and pressed events, you need to override the IsInpuKey method and return true for the keys you wish your control to process.
e.g. to get a control to process the Tab key.
[csharp]
protected override bool IsInputKey(System.Windows.Forms.Keys keyData)
{
switch (keyData)
{
case Keys.Tab: return (true);
default:
return (base.IsInputKey(keyData));
}
}
[/csharp]
Recent Comments