Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have code for a windows app with one form, Can I convert this to a console app using no forms? If so, yhen how?
Thanks
DS
Posted

Of course you can. You would need to replace the UI with a console based UI. So any info you have on screen would have to be written to the console. And all forms of input would also come from the console. The core flow of the app may also change a bit because of the different input/output models between GUI and console apps.

There is no automatic conversion tool though as far as I know.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 24-Apr-11 13:05pm    
Fair enough, my 5.
--SA
Just try google for this
convert a Windows App to a Console App[^]
 
Share this answer
 
Comments
Member 7766180 24-Apr-11 11:58am    
Will look around, it seems that it can be done but not too easy, Fortunately I only have one form.
Thanks
DS
XgenX 15-Oct-21 14:00pm    
This is a disappointing "answer" for someone who found this by googling for that phrase, no? "Google your question" is not still considered an answer, is it? If it ever was.
You can change the project settings to create a Console Application instead of a Windows Application (just hit Ctrl+Enter on the project in the Solution Window, and make that change).

That will compile the application as a Console Application, and you'll get a console. However, you'll still get your forms. If you want to not have Windows Forms, you'll need to remove the forms, and replace their functionality with command line arguments or configuration. You can then remove the Windows Forms references, and it'll be converted.
I've copied it from
http://stackoverflow.com/a/3427089[here] answered by Reed Copsey
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900