c#winform登录(关闭当前form跳转到另一个form)转载

原创
小哥 3年前 (2022-10-17) 阅读数 34 #大杂烩

验证帐户和密码后,执行以下代码

System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc));
t.ApartmentState =System.Threading. ApartmentState.STA;
t.Start();
this.Close();

ThreadProc()功能代码如下。功能代码如下。

public static void ThreadProc()
{
Application.Run(new mainForm());//mainForm是要打开的窗口是要打开的窗口
}

版权声明

所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除

热门