Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,有一个 Windows 应用程序,当按下shift+时,它应该聚焦到前一个文本框,背景颜色会发生变化。tab
e.Modifiers == Keys.Shift && e.KeyCode == Keys.Tab
在事件处理程序方法中,可能使用 if 条件。
尝试这个,
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Tab && e.Shift) { } }