How Do I Perform Action When CTRL + F Is Pressed On A Form

  • Thread starter Thread starter Benjamin Cauldwell
  • Start date Start date
B

Benjamin Cauldwell

How do I perform an action when the Control button and the
F Key are pressed at the same time?
 
Hello,

Benjamin Cauldwell said:
How do I perform an action when the Control button and the
F Key are pressed at the same time?

Add a hidden MainMenu control and define Ctrl+F as 'Shortcut' for an item.
 
Hi Benjamin,

in your form,

override protected bool ProcessCmdKey( ref System.Windows.Forms.Message msg, Keys keydata )
{
if ( keydata == (Keys.F | Keys.Control) )
{
Console.WriteLine( "Yeah" );
}
return base.ProcessCmdKey( ref msg, keydata );
}

regards,
Ulrich
 
Back
Top