여기 내 딜레마가 있습니다. 여기에 내가 가진이 코드입니다 :VB.NET에서 KeyDown을 처리하는 방법
지금은했습니다 경우 System.EventArgs '
'키 코드의 금주 모임 구성원이 아닌 '내가 Form1_KeyDown에 따라 본을 입력 할 때 지금
If e.KeyCode = Keys.A Then
TextBox1.AppendText("C, ")
PictureBox2.Visible = True
My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
End If
, 시각적 기본이 생각 전에이 코드 작업을 본 적이 있지만 여기에는 없습니다. 어떤 도움이 필요합니까?
여기에 전체 코드 : 당신 방법을 정의 EventArgs
로 e
선언하지만 수정 유형 KeyEventArgs
의 매개 변수를 확인하는 것입니다 왜
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.A Then
TextBox1.AppendText("A, ")
PictureBox2.Visible = True
My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
End If
If e.KeyCode = Keys.S Then
TextBox1.AppendText("C,")
PictureBox14.Visible = True
My.Computer.Audio.Play(My.Resources.D, AudioPlayMode.Background)
End If
End Sub
당신이 (서브 선언 포함) 전체 이벤트 핸들러 메소드의 코드를 포함 할 수 있습니다 VB에서 일해야 하는가? –