其中控制使用快速文本输入(输入框)? [英] Which control to use for quick text input (inputbox)?
问题描述
我需要一个快速的文本输入对话框(消息框在一个单一的文本框)。是否有任何可用的控制或者我应该用一种形式?
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?
我只是想用户输入一些ID。而在其他场合,我想2 texboxes用户名和密码。
I just want user to enter some ID. And in other occasion I want 2 texboxes for username and password.
推荐答案
Microsoft.VisualBasic.dll中有一个<一个href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.interaction.inputbox.aspx">InputBox方法,你可以从C#用它来获得一个字符串。
Microsoft.VisualBasic.dll has an InputBox method which you can use from C# to get a single string.
例如(添加引用第一个Microsoft.VisualBasic.dll中)
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,你必须使自己的形式。
Othewise, you'll have to make your own form.
这篇关于其中控制使用快速文本输入(输入框)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!