Can a Console Applicatons use forms

N

newbie

If I am creating a concole application can I acces GUIs.

The textbook gives me the following code but I get and error stating
"type or namespace name "Windows" does not exist in class or namespace
"System" (are you missing and assembly reference?)"

I know I can do it in a Windows app but is is possible to use form in a
concole application and if so what further code do I need?


using System;
using System.Windows.Forms;
public class Contact
{

public static void Main()
{
string msg = "Hello World";
MessageBox.Show(msg,"Hello Information");
}
}
 
M

Michael Nemtsev

Hello newbie,

Just add reference to the System.Windows.Forms.dll for your project

n> If I am creating a concole application can I acces GUIs.
n>
n> The textbook gives me the following code but I get and error stating
n> "type or namespace name "Windows" does not exist in class or
n> namespace "System" (are you missing and assembly reference?)"
n>
n> I know I can do it in a Windows app but is is possible to use form in
n> a concole application and if so what further code do I need?
n>
n> using System;
n> using System.Windows.Forms;
n> public class Contact
n> {
n> public static void Main()
n> {
n> string msg = "Hello World";
n> MessageBox.Show(msg,"Hello Information");
n> }
n> }
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top