Making System.Console.WriteLine() text outputs visible in a GUI program ?

K

Ken Williams

In general the program is GUI based.

However sometimes I would like to wirte some text lines to Console as if it is
a Console program.

When I write a System.ConsoleWriteLine() statement this is accepted without error (during build and
runtime). Unfortunately no Cosole pops up at runtime and showing the text.

I assume I have to enable the Console resp. make it visible and let it popup when necessary.

How do I do this (from a GUI program) ?`

Ken
 
J

Jon Skeet [C# MVP]

In general the program is GUI based.

However sometimes I would like to wirte some text lines to Console as if it is
a Console program.

To *which* console though - that's the issue.
When I write a System.ConsoleWriteLine() statement this is accepted
without error (during build and
runtime). Unfortunately no Cosole pops up at runtime and showing the text.

I assume I have to enable the Console resp. make it visible and let it popup
when necessary.

How do I do this (from a GUI program) ?

Rather than bring up a "real" console, I suggest you use a textbox or
something similar. Redirect Console.Out and Console.Error to
TextWriters which write to the textbox.

Jon
 
R

RYAN W

u can see the text in the window of menubar - debug - window-outputs.

i havn't find ways on how to start the console.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top