M
M
Max Bogachov2017-08-23 15:24:38
WPF
Max Bogachov, 2017-08-23 15:24:38

How to make console in WPF window?

Good day!
The other day I wondered - how to make your console in a WPF window ?
Meaning that the console is built into the WPF window!
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Peter, 2017-08-23
@petermzg

The console is the execution of commands and the display of the results of their execution.
For entering commands, a TextBox with the TextWrapping="Wrap" and AcceptsReturn="True" parameters is suitable.
Catches Enter and execute a command on it

Process proc = new Process();
proc.StartInfo.FileName = "команда.exe";
proc.StartInfo.Arguments = "<ее параметры>";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();

Get the execution result
and write to your TextBox

I
Iron Bug, 2017-08-25
@rare

https://www.nuget.org/packages/ConsoleControlWPF/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question