how do I stdout to a form instead of console

  • Thread starter Thread starter DougE
  • Start date Start date
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?
 
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.
 
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?
 
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.
 
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
 
Back
Top