-2
我试图让我的程序最小化和最大化按键(我使用h键)。按键最小化和最大化程序
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
Select Case e.KeyChar
Case "h"
If Me.WindowState = FormWindowState.Maximized Then
Me.WindowState = FormWindowState.Minimized
ElseIf Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Maximized
End If
End Select
End Sub
End Class
我不明白它为什么赢得'工作。
可能重复[听程序在后台时按键](http://stackoverflow.com/questions/38153300/listen-to-key-press-when-the-program-is-in-背景) –
这是做什么呢? – Brandon
@Brandon:可能没什么。我怀疑这与他按下键时没有专注的表单有关。 –