F1~10 펑션키 처리
C# / 2020. 8. 15. 23:32
//Form1.Designer.cs this.KeyPreview = true;//이거 넣어야 작동함 this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.From1_KeyDown); //Form1.cs private void From1_KeyDown(object sender, KeyEventArgs e) { switch(e.KeyCode) { case Keys.F2: OnKey_F2(); //e.Handled = true; break; case Keys.F3: OnKey_F3(); e.Handled = true; break; default: break; } }
'C#' 카테고리의 다른 글
Visual Studio 탭문자가 공백문자로 자동변경되는 문제 (0) | 2020.09.28 |
---|---|
콘솔창에 메세지 출력. DEBUG_puts (0) | 2020.08.15 |
Form 닫을때, 숨기기 (0) | 2020.07.18 |
다이얼로그창 DoModal, ShowDialog (0) | 2020.07.18 |
C#-F1, F2 key 펑션키 처리방법 (0) | 2020.07.11 |