4 Replies - 20524 Views - Last Post: 17 June 2008 - 12:24 PM Rate Topic: -----

#1 skyHigh   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 01-October 07

is it possible to create dialogbox on console application project?

Posted 17 June 2008 - 12:19 AM

I'm new to C#, and all the examples I look so far when creating dialogbox always have to choose window form, but I'm just wondering is it possible to create dialogbox when working on console application? If possible, may I know what is the function called?

thanks in advance.
Is This A Good Question/Topic? 0
  • +

Replies To: is it possible to create dialogbox on console application project?

#2 cygnusX   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 159
  • Joined: 19-May 07

Re: is it possible to create dialogbox on console application project?

Posted 17 June 2008 - 12:41 AM

No,you cant.But you can make windows forms application which looks like console.Like this.You need form with BorderStyle property set to None.Why do you use console application anyway?

This post has been edited by cygnusX: 17 June 2008 - 12:42 AM

Was This Post Helpful? 0
  • +
  • -

#3 zakary   User is offline

  • D.I.C Regular
  • member icon

Reputation: 27
  • View blog
  • Posts: 427
  • Joined: 15-February 05

Re: is it possible to create dialogbox on console application project?

Posted 17 June 2008 - 04:22 AM

Yes you can use Dialog boxes in a Console Application. You will need to add a .NET References to System.Windows.Forms then you can add code like:

bool continuing = true;
//Show a simple Yes No Dialog box where No is like cancel.
continuing = System.Windows.Forms.MessageBox.Show(
                "Do you really want to exit?", "Exit Prompt", System.Windows.Forms.MessageBoxButtons.YesNo,
                System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes;


Was This Post Helpful? 0
  • +
  • -

#4 skyHigh   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 01-October 07

Re: is it possible to create dialogbox on console application project?

Posted 17 June 2008 - 09:09 AM

View Postzakary, on 17 Jun, 2008 - 04:22 AM, said:

Yes you can use Dialog boxes in a Console Application. You will need to add a .NET References to System.Windows.Forms then you can add code like:

bool continuing = true;
//Show a simple Yes No Dialog box where No is like cancel.
continuing = System.Windows.Forms.MessageBox.Show(
                "Do you really want to exit?", "Exit Prompt", System.Windows.Forms.MessageBoxButtons.YesNo,
                System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes;




Can I have a dialogbox that asks for user inputs such as entering string, int or click on the radio check box?

View PostcygnusX, on 17 Jun, 2008 - 12:41 AM, said:

No,you cant.But you can make windows forms application which looks like console.Like this.You need form with BorderStyle property set to None.Why do you use console application anyway?



I just want to explore C# because I'm new to it so I wonder why people prefer window form alot rather than console because I was taught to use console since my main background language is C or C++.
Was This Post Helpful? 0
  • +
  • -

#5 zakary   User is offline

  • D.I.C Regular
  • member icon

Reputation: 27
  • View blog
  • Posts: 427
  • Joined: 15-February 05

Re: is it possible to create dialogbox on console application project?

Posted 17 June 2008 - 12:24 PM

View PostskyHigh, on 17 Jun, 2008 - 12:09 PM, said:

Can I have a dialogbox that asks for user inputs such as entering string, int or click on the radio check box?


Kind of, what you can do is create your own DialogBox with a Windows Form. Just because you have a Console App. you are not limited to just the Console you can create Forms and use them as you wish.
Was This Post Helpful? 1

Page 1 of 1