【问题标题】:(C#) Disable specific parts of a RichTextBox(C#) 禁用 RichTextBox 的特定部分
【发布时间】:2015-12-29 17:10:32
【问题描述】:

目前我正在尝试编写我自己的控制台来处理我的程序的不同服务。 我使用 RichTextBox 作为输入和输出,我希望我的程序看起来像一个 linux 终端或 Windows 控制台。 问题是没有默认方法可以禁用特定行的写入。 有没有更好的方法来构建这样的控制台?

At the end it should look like this (e.g of using my console):
everything in () is just for information

(user starting prog)
(green_color)system >> checking current configuration...
(blue_color)system >> configuration loaded!
(now its time for the user)
(waiting for user input, color white)ServerManager >> 
(user entered text, color white)ServerManager >> run mysql-service
(green_color) system >> staring mysql-service...
(blue color) system >> mysql-service started!
(white color, waiting for user input)mysql >> ...

【问题讨论】:

    标签: c# terminal console richtextbox


    【解决方案1】:

    不幸的是,您想要做的超出了富文本控件的范围。

    粗略的 Google 搜索显示了一堆终端仿真项目和具有不同功能的控件 - 但是这些也实现了各种协议,例如 SSH,而不仅仅是给你一个“控制台”。

    自己动手并非易事,但完全有可能。如果您按照 SO question & answer 使用 WPF,那就更容易了。

    【讨论】:

      猜你喜欢
      • 2018-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多