Solved

Convert Windows Form Application to Console Application

Posted on 2013-01-11
5
420 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 69

Accepted Solution

by:
Éric Moreau earned 250 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 69

Assisted Solution

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

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 125 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 125 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now