Sure, it's not even hard. Just create a console project (so VS creates void
main) but also have your class inherit from System.Windows.Forms.Form. In
Main, do all required command line parsing to decide whether you want to run
as an app or in a console. For example, if the EXE is started with no
arguments you might want to run as an app. Or you could have a switch
indicating wether to start the UI or not. Create an instance of your form.
You can run this as a Windows app by using:
System.Windows.Forms.Application.Run(<instance of your form>);
If you don't want to start the UI, just use the form object as you would
work with any other class.
Hope this helps.
--
Kai Brinkmann [MSFT]
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"ttan" <tt**@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
Is there anyway we can write an Application project and also have an
option
for console where it take the command line for input?
Thanks