|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to trap F5 in Windows Forms?I have created a simple form that displays a simple message. But the message cant seem to be displayed? Any reason why? Below is my code. private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if(e.KeyCode == Keys.F5) { MessageBox.Show("It is done"); } } Set the KeyPreview of your form to true.
"Ryu" <blizzardstorm8***@yahoo.com> wrote in message System.Windows.Forms.KeyEventArgsnews:#udhkIs0EHA.1940@TK2MSFTNGP15.phx.gbl... > Hi All, > > I have created a simple form that displays a simple message. But the message > cant seem to be displayed? Any reason why? Below is my code. > > private void Form1_KeyDown(object sender, Show quote > e) > > { > > if(e.KeyCode == Keys.F5) > > { > > MessageBox.Show("It is done"); > > } > > } > > |
|||||||||||||||||||||||