消息框与输入字段 [英] Messagebox with input field
本文介绍了消息框与输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
时它可以显示(弹出)一个消息框,输入框在里面,可能是一个文本框?在语言或框架somewehre?
Is it possible to show (pop-up) a message box with an input field in it, possibly a text box? Is somewehre in the language or the framework?
推荐答案
不幸的是C#中没有这样的事情,你必须自己做一个。但是,你可以尝试引用 Microsoft.VisualBasic.dll中
。
Unfortunately C# does not have anything like that, you will have to make one yourself. But, you can try referencing Microsoft.VisualBasic.dll
.
然后用下面的code。
Then using the code below.
Microsoft.VisualBasic.Interaction.InputBox("Question?","Title","Default Text");
另外,通过增加一个使用
指令,允许在code较短的语法(这我个人preFER)。
Alternatively, by adding a using
directive allowing for a shorter syntax in your code (which I'd personally prefer).
using Microsoft.VisualBasic;
...
Interaction.InputBox("Question?","Title","Default Text");
或者,你可以做什么Pranay拉纳指出,这就是我所做的太...
Or you can do what Pranay Rana suggests, that's what I would've done too...
这篇关于消息框与输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文