小工具搬运工

搬运一些实用的小工具

解决办法有两种:

第一种:在主方法上加上[STAThread]特性标签

[STAThread]
static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new LogInForm());
}

第二种:将线程的单元状态设置为单线程单元,thread.SetApartmentState(ApartmentState.STA);

Thread th = new Thread(()=> new Form1().ShowDialog());
th.SetApartmentState(ApartmentState.STA);
th.Start();

1857359-20191106115153805-1080565665.png


扫描二维码,在手机上阅读!

添加新评论 »

在这里输入你的评论...

© 2025 小工具搬运工. . 京ICP备17053127号