在控制台中添加Windows表单 [英] Add windows forms in Console

查看:121
本文介绍了在控制台中添加Windows表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在编写我的编程语言,但是我需要创建新的Windows窗体.我需要能够输入如下代码:

hey guys,

i am making my programming language, but i need to make new windows forms. I need to be able to type in a code like:

new winform



然后制作一个全新的Windows窗体.并非如此,当我制作它时,它已经具有Windows窗体,但是能够使用代码制作它.



and then it makes a whole new windows form. Not so that when i make it, it have a windows form already, but being able to make one using code.

推荐答案

您不能完全做到这一点-控制台应用程序没有与Windows窗体应用程序相同的消息循环.
您可以使用Process.Start执行Windows窗体应用程序,然后从那里进行交谈,但不能在控制台应用程序中创建Windows窗体.
You can''t quite do that - Console applications do not have a message loop in the same way that Windows forms apps do.
You can execute a Windows Forms application using Process.Start, and talk to it from there, but you can''t create a windows form within a console app.


这篇关于在控制台中添加Windows表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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