开发者

Create a form in the main thread? [closed]

It's difficult to tell开发者_如何学Python what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

Can someone please explain how I can create a form in the main thread of my application, using C#?


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


What I know and based on previous answers here, The form you will create will be by default in the main thread.

You need to look at other answers as well for details and code sample for creating a form.


Form1 form = new Form1();
form.Show();

But I don't think that is what you want as an answer. Maybe detail it a bit more?


Here is the code you can use:

Form form = new Form();  
form.Show();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜