tags:

views:

53

answers:

2

Hello,

I need a quick text input dialog box. (MessageBox with a single Text box in it). Is there any control available or should use a form?

I just want user to enter some ID. And in other occasion I want 2 texboxes for Username & Password.

+1  A: 

simple one is inputbox

Fredou
inputbox in C#???
claws
yes, use import microsoft.visualbasic.dll
Fredou
Don't fear the namespace.
Will
Yes; see my answer.
SLaks
+1  A: 

Microsoft.VisualBasic.dll has an InputBox method which you can use from C# to get a single string.

For example (Add a reference to Microsoft.VisualBasic.dll first)

using Microsoft.VisualBasic;

string response = Interaction.InputBox("Enter a string:", "MyApp", "DefaultString", 0, 0);

Othewise, you'll have to make your own form.

SLaks