how do I stdout to a form instead of console

D

DougE

Some people tryed to help in my previous post. But I don't quite have it.
What I want to do is send stdout to something on a form textbox, panel,
listbox -- something. I want to write to a form the same way you would
write to a console using console.write(), except I want to send that output
to something on a form. Is this possible?
 
T

Terry

Well I guess you could have a multi-line textbox on a form and then set it's
text property to the text you want to write to the console. So you would
first set up a string with the formated data that you would of sent to the
console and then set the textbox's text property to that string. There are
other techniques to 'write' on a form or picture box which involve getting
their graphics device and using its 'DrawString' method.
 
D

DougE

I don't think so. It has to do with creating either a stringwriter or
streamwriter object, I don't know which, then redirecting the standard output
from the console somehow with a memeber of the console class and
writeline(ing) it to either the stringwriter or streamwriter object which you
send to the form. Sounds easy, huh? Then why is it so hard to find a [SANE]
example?
 
F

Family Tree Mike

DougE said:
I don't think so. It has to do with creating either a stringwriter or
streamwriter object, I don't know which, then redirecting the standard output
from the console somehow with a memeber of the console class and
writeline(ing) it to either the stringwriter or streamwriter object which you
send to the form. Sounds easy, huh? Then why is it so hard to find a [SANE]
example?

This sounds like maybe you are trying to run some external program via a
Process.Start(), and capture that processes output for your form rather than
to the standard console. Do I understand correctly? If so, then when you
create your Process instance, you need to follow something like the following
link:
http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx.

Once you read the output, you need to stuff the output into a control as
Terry suggested, or using my favorite, which is a listbox control.

If I'm misunderstanding your goal, please clarify how I'm mistaken.
 
C

Cor Ligthert[MVP]

You cannot use stdout in VB.Net.

You have at least to use a from C derived language.

However to get your result is a full docked textbox with the right
properties enough.

Cor
 

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