473,413 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

How to getting console messages to Textbox

ano
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
Mar 24 '06 #1
4 3089
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

Mar 24 '06 #2
ano
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


Mar 24 '06 #3
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


Mar 24 '06 #4
A console application is an application that uses the console for a user
interface. A Windows Form application is an application that uses a windowed
user interface. Other than that, they are the same. In other words, if you
want the same functionlity to be able to be presented in multiple types of
interfaces, you separate the business logic from the interface logic.

--
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: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


Mar 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jon Davis | last post by:
Does anyone know where I can get my hands on a textbox console, like the Immediate textbox in Visual Studio (any), in which I can map I/O streams such that a class library built for a console app...
1
by: sharp | last post by:
I'm a newbie to C# and C++. I have a C# app using windows forms that call a native dll passes in the window's hwnd and the dll uses PostMessage to send messages to the C# app. This works great. ...
1
by: Teis Draiby | last post by:
I am working on a Win32 program with an additional console window to output messages. I also want to type commands in the console window. Is there any common way to achieve that? For example how...
6
by: Flip | last post by:
In j2ee/JBuilder/WebLogic when you do a System.err.println(), you can see the messages in the console that started the server. When I tried the same type of thing with VS 2k3 .NET and ASPX, I...
7
by: Microsoft | last post by:
I'm not sure where to physically place my subroutines in vb.net I get namespace and not declared errors... Imports System Imports System.Management Public Class Form1
5
by: per9000 | last post by:
Hi all, I want to create an encryption program and started thinking about not storing sensitive information in the memory since I guess someone might steal my computer an scan my memory. So I...
5
by: rn5a | last post by:
A Web Form has a TextBox within a DataGrid wherein users are expected to enter only whole numbers. It should be validated so that the TextBox doesn't remain blank or any non-numeric data is...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
0
by: skyros2007 | last post by:
Hi everyone! Please help. I need to capture the output messages from the windows console and have it displayed into a textbox. I will execute a perl script through my VB code and I need the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.