WPF 的控制台控件
这个问题已经以多种不同的方式被问到,但我还没有找到答案。我想在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以使您的应用程序成为控制台应用程序,这为您提供了真正的控制台。
否则,如果您只想输入和输出,通常可以通过 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.