Add windows form app to my console app
-
Friday, August 31, 2012 3:02 PM
Hi,
Quick question, I have a windows form project that i want to add to my console app.
How do u do that?
Chase Turvey HI-LO SWAG!
All Replies
-
Friday, August 31, 2012 4:28 PM
When you say "you want to add it" - you typically wouldn't "add" the project, but you can build the WIndows Forms project and reference it from your Console Application. Your console app could then use the public types defined in the forms project.
However, if you want to open and display forms, it's typically easier to work from a forms application, as the application startup logic needs to happen so there is a running message pump on the main/UI thread.
Reed Copsey, Jr. - http://reedcopsey.com
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful". -
Friday, August 31, 2012 7:25 PM
Hi,
Quick question, I have a windows form project that i want to add to my console app.
How do u do that?
Chase Turvey HI-LO SWAG!
If you want something you've never had, you need to do something you've never done.
- Marked As Answer by Chase Turvey Friday, August 31, 2012 8:26 PM
-
Friday, August 31, 2012 7:47 PMThanks! Sorry but how to i show form1 from my console?
Chase Turvey HI-LO SWAG!
-
Friday, August 31, 2012 7:52 PM
Thanks! Sorry but how to i show form1 from my console?
Chase Turvey HI-LO SWAG!
First add a reference to System.Windows.Forms.
then your console code can launch a form like this:
Imports System.Windows.Forms 'Import this after you add a reference to it Module Module1 Sub Main() Application.Run(New Form1) End Sub End Module
If you want something you've never had, you need to do something you've never done.
- Marked As Answer by Chase Turvey Friday, August 31, 2012 8:26 PM
-
Friday, August 31, 2012 8:26 PMThanks it works!
Chase Turvey HI-LO SWAG!
-
Friday, August 31, 2012 8:31 PM
Thanks it works!
Chase Turvey HI-LO SWAG!
You're welcome!If you want something you've never had, you need to do something you've never done.

