For some reason, I am not snagging the event. I have created a base child
form where the derived child form is embedded within an MDI parent
container. The child form is in focus and when I press the appropriate
function key, no event is fired.
My test code looks as follows:
private void ChildViewBase_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.F1:
F1KeyPressed();
break;
case Keys.F2:
F2KeyPressed();
break;
}
protected virtual void F1KeyPressed() {}
protected virtual void F2KeyPressed() {}
"Catalin Stefan Goilav" <ca**@bsc.ro> wrote in message
news:eQ**************@TK2MSFTNGP09.phx.gbl...
For any object that has the keyDown event, you can use (example for a form
named Form1):
private void Form1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.F1) DoSomething();
}
hope that helps....
Cata
"Sean Connery" <nf*@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Does someone know the syntax to detect when certain function keys are
pressed?