Solved

Convert Windows Form Application to Console Application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get id from json Data with NewtonSoft 3 35
Word Directory is not in the drop down list 4 26
Not showing page correctly 3 31
Error on Add method 1 38
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

26 Experts available now in Live!

Get 1:1 Help Now