c# - 키입력 처리
C# / 2020. 6. 6. 22:49
입력을 처리할 GUI객체에서,
속성창에서 번개 아이콘을 누르고, 이벤트 추가
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { // Determine whether the key entered is the F1 key. If it is, display Help. if(e.KeyCode == Keys.F1 && (e.Alt || e.Control || e.Shift)) { // Display a pop-up Help topic to assist the user. Help.ShowPopup(textBox1, "Enter your name.", new Point(textBox1.Bottom, textBox1.Right)); } else if(e.KeyCode == Keys.F2 && e.Modifiers == Keys.Alt) { // Display a pop-up Help topic to provide additional assistance to the user. Help.ShowPopup(textBox1, "Enter your first name followed by your last name. Middle name is optional.", new Point(textBox1.Top, this.textBox1.Left)); } }
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { // Determine whether the key entered is the F1 key. If it is, display Help. if(e.KeyCode == Keys.F1 && (e.Alt || e.Control || e.Shift)) { // Display a pop-up Help topic to assist the user. Help.ShowPopup(textBox1, "Enter your name.", new Point(textBox1.Bottom, textBox1.Right)); } else if(e.KeyCode == Keys.F2 && e.Modifiers == Keys.Alt) { // Display a pop-up Help topic to provide additional assistance to the user. Help.ShowPopup(textBox1, "Enter your first name followed by your last name. Middle name is optional.", new Point(textBox1.Top, this.textBox1.Left)); } }
'C#' 카테고리의 다른 글
c# - 이벤트 추가방법 (0) | 2020.06.13 |
---|---|
c# 매크로 기능은 있지만, 없는거나 마찬가지이다. (0) | 2020.06.06 |
C# - enum 사용법 (0) | 2020.06.06 |
error CS1955: 호출할 수 없는 멤버인 'xx'은(는) 메서드처럼 사용할 수 없습니다. (0) | 2020.05.30 |
error CS0120: 비정적 필드, 메서드 또는 속성 "xx"에 개체 참조가 필요합니다. (1) | 2020.05.30 |