110,580
社区成员
发帖
与我相关
我的任务
分享
SendKeys.SendWait("{F11}");
SendKeys.Flush();
private void btn_f11_Click(object sender, EventArgs e)
{
SendF11();
}
public void SendF11()
{
Thread.Sleep(5000);
SendKeys.SendWait("{F11}");
SendKeys.Flush();
}
public Form1()
{
InitializeComponent();
Control.ControlCollection cc = this.Controls;
for (int i = 0; i < cc.Count; i++)
{
if (cc[i].GetType() == typeof(Button))
{
cc[i].Click += new EventHandler(Form1_Click);
}
}
}
void Form1_Click(object sender, EventArgs e)
{
A a = new A(sender);
}
class A
{
public A(object sender)
{
if (sender.GetType() == typeof(Button))
{
SendKeys.SendWait("{F11}");
SendKeys.Flush();
}
}
}