简体   繁体   中英

How to run a Windows Form in a C# application

I am new to Visual Studio and I have just designed a simple Form that captures some user input text and displays it to the screen. However, I don't know how to include this Form in a C# application. The code in the Form1.cs file is obviously incomplete -- ie, it does not contain any formatting data.

Any advice is appreciated.

Regards.

If you use the normal WIndows Forms application template, Form1 will automatically load when you run.

If not, I recommend building a template program, and looking at Program.cs - it shows the typically boilerplate code used to launch the "main" form and start the application properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM