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 / .NET Framework / .NET SDK / July 2003

Tip: Looking for answers? Try searching our database.

Console Window and CSharp Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michel Racicot - 17 Jul 2003 15:51 GMT
Why do I obtain a console Window in addition to my CSharp Form when I do the
following code:

using System.Windows.Forms;

class MyWindow: Form
{
}

class MyApp
{
 static void Main ()
 {
   Application.Run (new MyWindow ());
 }
}

?
Gheorghe Marius - 17 Jul 2003 15:52 GMT
Because the output type of your exe is Console Application instead of
Windows Application. Set it wo Windows Application and the consolw thingie
won't appear anymore.

Cheers,
Marius.

> Why do I obtain a console Window in addition to my CSharp Form when I do the
> following code:
[quoted text clipped - 14 lines]
>
> ?
Michel Racicot - 17 Jul 2003 15:57 GMT
Thank you a lot for the quick answer!

> Because the output type of your exe is Console Application instead of
> Windows Application. Set it wo Windows Application and the consolw thingie
[quoted text clipped - 22 lines]
> >
> > ?
Jon Skeet - 17 Jul 2003 15:57 GMT
> Why do I obtain a console Window in addition to my CSharp Form when I do the
> following code:
[quoted text clipped - 12 lines]
>   }
> }

Make the project type a console application instead of a Windows
application and you'll get both.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Jon Skeet - 17 Jul 2003 16:41 GMT
> > Why do I obtain a console Window in addition to my CSharp Form when I do the
> > following code:
[quoted text clipped - 15 lines]
> Make the project type a console application instead of a Windows
> application and you'll get both.

Apologies - I misread the question, thinking that you *wanted* both a
console and a GUI. Make the project type Win32 Application (or whatever
it's called - just not Console).

From the command line, you can build with /t:winexe to do the same
thing

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too


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.