Why are WinForms applications STAThread by default?

后端 未结 4 1619
醉话见心
醉话见心 2020-12-03 22:11

When you create an empty WinForms application with Visual Studio, the template has the STAThread attribute in the main application class.

4条回答
  •  借酒劲吻你
    2020-12-03 22:23

    It means that Windows Forms programs use a single-threaded apartment state. MTA and free threaded apartment states are not supported.

提交回复
热议问题