我需要在线程末尾设置一个按钮焦点。Button.Focus() 方法似乎不起作用。
例如:
Button1_Click(object sender, EventArgs e)
{
Thread myThread = new Thread(theThread);
myThread.Start();
}
theThread()
{
...
Button2.Focus(); // does not seem to focus the button
}
但是,如果我将 Button2.Focus() 放在 Button1_Click 中,它将聚焦,但对于我的项目,我不能这样做。