First you need to redirect the motor output to the console
engine.Runtime.IO.RedirectToConsole();
Then you need to redirect the NET Console Out to a custom TextBox TextWriter. Here is your TextBox - txtBoxTarget
// set application console output to the output text box Console.SetOut(TextWriter.Synchronized(new TextBoxWriter(txtBoxTarget)));
And finally, you need to implement a custom TextBox TextWriter.
using System; using System.IO; using System.Windows.Forms; namespace PythonScripting.TestApp { class TextBoxWriter : TextWriter { private TextBox _textBox; public TextBoxWriter(TextBox textbox) { _textBox = textbox; } public override void Write(char value) { base.Write(value);
code>
Just really.
source share