如何在vb.net中的控制台中创建菜单和单击事件? [英] How do I create menus and click events in console in vb.net?

查看:98
本文介绍了如何在vb.net中的控制台中创建菜单和单击事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想知道如何重新创建QuickVB的图形。

这就是说,我想重新创建语法高亮,菜单和点击事件我自己的控制台。我有QuickVB的来源,但我不知道如何使用它。



任何帮助将不胜感激。

谢谢,iProgramIt。

Hi guys,
I was wondering how to recreate the graphics that QuickVB has.
That said, I would like to recreate syntax highlighting, menus and click events in my own console. I have the source for QuickVB but I do not know how to use this.

Any help would be appreciated.
Thanks, iProgramIt.

推荐答案

这是我的建议:不要浪费你的时间(请参阅我对问题的评论)。如果需要任何输入,大多数合理的控制台应用程序都会使用命令行进行用户输入。如果某些部分如果信息太大,那么某些参数可以是文件名,其中更高级的格式表示输入数据。 (作为一个例外,还有完全成熟的指挥口译员,但我认为你不必考虑这种方法。)



那么请看我的实用程序类库,用于高度可管理且易于使用的命令行解析,以及我在文章中引用的另一个库:基于枚举的命令行实用程序 [ ^ ]。



-SA
Here is my advice: don't waste your time on that (see my comment to the question). Most reasonable console applications use command line for user input, if any input is required at all. If some pieces if information are too big for that, some parameters can be file name with more advanced format presenting input data. (As an exclusion, there are also fully-fledged command interpreters, but I don't think you have to consider this approach.)

By the way, please see my utility class library for highly manageable and easy to use command-line parsing, and another library I reference in my article: Enumeration-based Command Line Utility[^].

—SA


iProgramIt写道
iProgramIt wrote



嗯,是的。我知道,但由于一些奇怪的原因,我喜欢旧式的图形。 QuickVB是一种可能的演示,如果你有Windows XP或更早版本,MSEDIT也是一个演示。我目前不想要Windows Forms等。无论如何,谢谢你的输入。


Hmm, yes. I know that, but for some odd reason I like old-style graphics. QuickVB is a demonstration that this is possible and if you have Windows XP or older, MSEDIT is also a demonstration. I do not currently want Windows Forms or the like. Anyway, thank you for the input.

你可以使用更精细的控制 System.Console :将字符输出到控制台坐标中的任意位置多色输出。这是涵盖您需要的大多数主题的教程: http:// broadcast。 oreilly.com/2010/08/understanding-c-text-mode-games.html [ ^ ]。



基于此,您可以制作任何文字 - 基本的窗口用户界面,包括菜单。



此外,你可以使用Unicode,因此伪图形使用盒子绘图字符 https://en.wikipedia.org/wiki/Box-drawing_character [ ^ ]。



您需要设置正确的编码,而不是默认设置的编码,但需要其中一个UTF: https://msdn.microsoft.com/en-us/library/system.console.outputencoding%28v=vs.110%29.aspx [ ^ ];

另请参阅支持的UTF编码和字体使用说明: https://msdn.microsoft.com/en-us/library/system.console%28v=vs.110%29.aspx [ ^ ](在控制台的Unicode支持部分) 。



-SA

The you can use more fine-grain control of System.Console: output of characters to an arbitrary position in console coordinates and multi-color output. This is the tutorial covering most of the topics you need: http://broadcast.oreilly.com/2010/08/understanding-c-text-mode-games.html[^].

Based on that, you can produce any text-basic windowed UI, including menus.

Moreover, you can use Unicode and hence pseudo-graphics using box-drawing characters: https://en.wikipedia.org/wiki/Box-drawing_character[^].

You need to setup proper encoding, not the one set by default, but one of the UTFs: https://msdn.microsoft.com/en-us/library/system.console.outputencoding%28v=vs.110%29.aspx[^];
see also the notes on supported UTF encodings and the use of a font: https://msdn.microsoft.com/en-us/library/system.console%28v=vs.110%29.aspx[^] (in the section "Unicode Support for the Console").

—SA


这篇关于如何在vb.net中的控制台中创建菜单和单击事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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