?
Solved

Convert Windows Form Application to Console Application

Posted on 2013-01-11
5
Medium Priority
?
446 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

801 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