Which control to use for quick text input (inputbo

2019-01-26 13:30发布

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

I just want user to enter some ID. And in other occasion I want 2 texboxes for username and password.

2条回答
2楼-- · 2019-01-26 13:58

simple one is inputbox

查看更多
做个烂人
3楼-- · 2019-01-26 14:07

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.

查看更多
登录 后发表回答