3

Does C# have a code that makes a prompt box appear so that you can insert a value on it? Like a messageBox but with a text field, like the one that javaScript has.

Or do I have to create a form for it?

Madcowe
  • 243
  • 3
  • 11
  • 3
    What kind of app are you writing? Is this a Windows Forms application, or an ASP.NET app, or a Windows Communication Foundation app, or a console application, or what? – Katie Kilian May 18 '11 at 13:27
  • 2
    possible duplicate of [Prompt Dialog in Windows Forms](http://stackoverflow.com/questions/5427020/prompt-dialog-in-windows-forms) – Matt Ball May 18 '11 at 13:27
  • `Microsoft.VisualBasic.Interaction.InputBox()` – Cody Gray - on strike May 18 '11 at 13:30
  • 4
    How is this not a real question? It may or may not be a duplicate, but the question is clear enough! (and the answer is appropriate!) – Tao May 18 '11 at 13:33
  • I did some research and didn't find any post with the keywords I used, sorry for re-asking it though... Either way, thanks for the answers, now I know ;) Also I am using windows forms C# (Visual studio 2008), not Visual Basic – Madcowe May 18 '11 at 13:33
  • There is no build in functionality like that, that I know of. See here: http://msdn.microsoft.com/en-us/library/bb383855(v=vs.90).aspx – SwDevMan81 May 18 '11 at 13:40
  • I really don't understand how can someone vote for close "not a real question" and vote down the question. – TcKs May 18 '11 at 20:31

1 Answers1

2

You can use InputBox method from VisualBasic Interaction class.

TcKs
  • 25,849
  • 11
  • 66
  • 104
  • thanks but I am currently programming in C# – Madcowe May 18 '11 at 13:35
  • 1
    There is no problem with C#. You only reference the Microsoft.VisualBasic.dll and then you can use the function. The Microsoft.VisualBasic.dll is core assembly in .NET Framework, so it's allways available. – TcKs May 18 '11 at 13:57