Answers for "how to detect f5 key in c#"

C#
1

how to detect f5 key in c#

private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.F5)
            {
                MessageBox.Show("F5-key pressed");
            }
        }

// or
public class DummyClass
{
  	public DummyClass()
  	{
      	 // event for any key pressed
        TreeList.KeyUp += TreeList_KeyUp;
    }
  
	 private void TreeList_KeyUp(object sender, KeyEventArgs e)
     {
         if (e.KeyData == Keys.F5)
         {
                GetData();
                ShowContent();
         }
       
      }
  	
}
Posted by: Guest on October-13-2020

Code answers related to "how to detect f5 key in c#"

C# Answers by Framework

Browse Popular Code Answers by Language