Well, rather than writing to *anything*, you could fire a bespoke message
event (including the string in the args), and then handle the event
differently in the two types of callers; you could do somthing similar with
either interfaces or inheritance - i.e. have an IMessageHandler {void
ShowMessage(string message);}, which different callers can implement and
supply - with the ConsoleMessageHandler : IMessageHandler writing to the
console, and (you get the idea).
(obviously you would need to be able to tell it which IMessageHandler to
use; perhaps a public static property somewhere)
Marc
"ano" <an*@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
Yes, I known that it is easier to chang every Console.WriteLine() to
Form.Textbox.
But I don't want to change it because I call the projects that still used
by
another console application.
Any idea?
Thanks,
ano
"Kevin Spencer" wrote:
It is possible to turn lead into gold, but buying gold is cheaper.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Show me your certification without works,
and I'll show my certification
*by* my works.
"ano" <an*@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com... >I have a console application and a lot of Console.WriteLine().
> Now I want to convert it to Windows Form Application.
>
> Is it possible to getting all of the console messages to Form.Textbox
> without changing every Console.WriteLine()?
>
> Thank you in advance.
> ano