我可以从控制台程序启动 Windows 窗体吗 [英] Can I start a windows form from a console program

查看:23
本文介绍了我可以从控制台程序启动 Windows 窗体吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'd like to start a new windows form from a console program. Is this possible?

推荐答案

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

Add a reference to Windows.Forms, then:

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

这篇关于我可以从控制台程序启动 Windows 窗体吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆