本文介绍了添加文本框在WinRT中MessageDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Windows工作8商店应用程序,我想弹出一个对话框,让用户在一个文本框,例如输入信息。
I'm working in windows 8 store application and I'm trying to popup a dialog to let the user enter information in a textbox for example.
如何做到这一点?
推荐答案的 显示InputDialog 在WinRT的XAML工具包的控制做到了这一点。它基本上是一个弹出式窗口控制文本框和一些按钮。有样本为它了。最基本的人做这样的:
The InputDialog control in WinRT XAML Toolkit does just that. It is basically a Popup control with a TextBox and some buttons. There is a sample for it too. The most basic one does this:
var dialog = new InputDialog(); var result = await dialog.ShowAsync( "This is the title", "This is the content/message", "Option 1", "Option 2", "Option 3");
其结果是,用在被点击的按钮字符串 - 例如选项1。
The result is the string that is used on the button that was clicked - e.g. "Option 1".
更多推荐
添加文本框在WinRT中MessageDialog
发布评论