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.
ctrl对于按钮,如何在click事件处理程序中检测是否是+点击按钮?我正在使用 C# 使用 VS 2010。
我们是在谈论 winforms、wpf 还是 asp 应用程序?我将快速假设它是winforms,所以这里是:
Form Form1; button.Click += click; private void click(object s, EventArgs e) { if(Form1.ModifierKeys == Keys.Control) ... // Whatever you need here }