Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI and console application

Status
Not open for further replies.

tg2003

IS-IT--Management
Feb 6, 2003
270
IL
Hello,

I'm a VB.NET rookie.

I have a Windows-forms application that has runs GUI and backend. Now I'm planning to add the option to run the application by command-line (CLI) only, with no GUI.

I have the following questions please:
1. I see that I can just hide the main form (me.visible = true). Is it best considered for an app that supports GUI and CLI?
2. How can I print messages to screen (console)? Currently I'm printing messages to a log file and to screen (msgbox function)

If you have another tips, it will be very appreciated.

Thanks!
 
I would make two executeables -- one for the WinForms app, and one for the command line app. You can encapsulate their common functionality in a Class Library, and reference that Class Library from both.
 
Check out the "Passing Parameter to Application" post in this forum, it might give you some ideas.

Auguy
Northwest Ohio
 
Answer to the second question...

You can write messages to the console using the following functions: Console.Write()or Console.WriteLine(). Both functions take string as parameter.

"Cowards die many times before their deaths, The valiant never taste of death but once." - Julius Caesar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top