WPF 的控制台控件

发布于 2025-01-02 00:00:17 字数 172 浏览 2 评论 0原文

这个问题已经以多种不同的方式被问到,但我还没有找到答案。我想在 WPF 窗口中添加一个模拟控制台的控件(用于写入和读取文本,可能带有颜色)。好吧......如果那里已经没有控件(这很奇怪,因为它是一种基本的),我将如何构建一个?

我的最终目标是构建一个 Powershell 主机,我可以在其中键入命令并获取输出。

This question has been asked in many different ways out there, but I have not found the answer yet. I want to add a control in my WPF window that simulates a console (for writting and reading text, possibly with colors). OK... if there is no control out there already (which is very strange since it's kind of basic), how would I go about building one?

My final goal is to build a Powershell host where I can type commands and get output.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独陪着我 2025-01-09 00:00:17

您始终可以使您的应用程序成为控制台应用程序,这为您提供了真正的控制台。

否则,如果您只想输入和输出,通常可以通过 TextBox 和/或 RichTextBox 或 WPF 文档支持

You can always make your application a Console application, which gives you a true console.

Otherwise, if you just want to have input and output, typically this can be done via TextBox and/or RichTextBox or the WPF Document Support.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文