我可以从控制台程序启动Windows窗体

use*_*949 0 winforms

我想从控制台程序启动一个新的Windows窗体.这可能吗?

Gre*_*som 6

添加对Windows.Forms的引用,然后:

static void Main(string[] args)
{
    Application.EnableVisualStyles();
    Application.Run(new Form()); //of course you can put your own custom Form here.
}
Run Code Online (Sandbox Code Playgroud)