Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

Converting Console App to Winform app

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Madalin Nicula - 21 Dec 2004 12:28 GMT
Hi
I have a console app which works fine and I want to convert it to a WinForm
app.Can anyone help me how to do it?
Herfried K. Wagner [MVP] - 21 Dec 2004 12:38 GMT
"Madalin Nicula" <MadalinNicula@hotmail.com> schrieb:
> I have a console app which works fine and I want to convert it to a
> WinForm app.Can anyone help me how to do it?

You can change the project type in the project properties dialog.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/

Teis Draiby - 21 Dec 2004 13:49 GMT
You also need to inherit your class from the 'System.Windows.Forms.Form'
class which will automatically activate Form Designer support (very nice
detail).
Remember to add a reference to the System.Windows.Forms dll.

This is the minimum code for a Windows Application:

--- Code --------------------------------
using System;
using System.Windows.Forms;

namespace MyNamespace
{
   class MyClass : System.Windows.Forms.Form
   {
       [STAThread]
       static void Main()
       {
           Application.Run( new MyClass() );
       }
   }
}
------------------------------------------

(To show what you created in the Form Designer you need to call
InitializeComponent() from the class constructor)

good luck, Teis

> "Madalin Nicula" <MadalinNicula@hotmail.com> schrieb:
> > I have a console app which works fine and I want to convert it to a
> > WinForm app.Can anyone help me how to do it?
>
> You can change the project type in the project properties dialog.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.