我用
开始一个表单if (Application.OpenForms.OfType<Form1>().Count() > 0)
{
MessageBox.Show("form is open");
//I want to bring the from to the top sine it is already running
}
else
{
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc1));
t.Start();
}
public static void ThreadProc1()
{
Application.Run(new Form1());
}
如果表单已经启动,我想将表单置于顶部 而不仅仅是启动表单打开的消息框。 我已经完成了搜索,似乎无法找到有效的解决方案