Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Convert Windows Form Application to Console Application

Posted on 2013-01-11
5
Medium Priority
?
451 Views
Last Modified: 2013-01-14
Hi all,

I have a Windows Form Application with a single form,
and I got rid of all the controls on it.
What is the best way to convert my project to Console Application?

Any help is appreciated,

Thank you
0
Comment
Question by:darrgyas
5 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 750 total points
ID: 38768457
why would you do that? if you just want to run your application from a scheduler, it does not require to be console.
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 750 total points
ID: 38768465
otherwise, start a new application using the console template and move the files you need
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 375 total points
ID: 38768526
Your forms code gets initiated thru either the Constructor, Load() or Shown() event.  Just move that code to the Main() method of your Console application (along with any supporting methods/functions).

If it's more complicated than that then please show us the code in question.
0
 
LVL 13

Assisted Solution

by:LIONKING
LIONKING earned 375 total points
ID: 38768544
Create a new project, add existing items for all your classes.
Copy all your logic (code) from the Form to the program.cs.

If any events have to be taken care of, you'll probably need to add some logic to the console application.

If it's not big, it would be easier if we saw at least the structure of the code.
0
 

Author Comment

by:darrgyas
ID: 38774151
I was hoping for some magic, like a tweak in a project file or something like that.
I guess not.
Thank you all
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question