473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Console Window and CSharp Form

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 ());
}
}

?
Nov 13 '05 #1
4 8715
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.
"Michel Racicot" <mi************@cognicase.ca> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
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 ());
}
}

?

Nov 13 '05 #2
Michel Racicot <mi************@cognicase.ca> wrote:
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 ());
}
}


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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 13 '05 #3
Thank you a lot for the quick answer!

"Gheorghe Marius" <cg********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.
"Michel Racicot" <mi************@cognicase.ca> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
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 ());
}
}

?


Nov 13 '05 #4
Jon Skeet <sk***@pobox.com> wrote:
Michel Racicot <mi************@cognicase.ca> wrote:
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 ());
}
}


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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
3
by: JMMB | last post by:
When working with a console application, how can i control the size and background color of the console window programmatically? thanks,
4
by: Bill Cohagan | last post by:
I'm writing a console app (in C#) and I want to be able to redirect the standard input/output streams when it's run at a command prompt. IOW I want to support the "<" and ">" redirection syntax....
4
by: Ron Vecchi | last post by:
I am looking for a way to write xml data to file from a macromedia flash executable. I was thinking about haveing flash call a console app with a parameter...which is the xml string to write to...
5
by: Pengyu | last post by:
Hi, How to add a console window to a Windows application? Thank you very much in advance, Pengyu
1
by: James Carnley | last post by:
I am learning how to use windows forms and I have come across a small problem. Whenever I run my program it opens a console window before launching the windows form. The console doesnt go away...
17
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
4
by: eduardorp1 | last post by:
I have a GUI application that needs to be invoked from the command line as well. It should work both as a GUI and as a console application. When I invoke it from the command line, it reads all...
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.