添加文本框在WinRT中MessageDialog

添加文本框在WinRT中MessageDialog

本文介绍了添加文本框在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.

如何做到这一点?

推荐答案

的<一个href="http://winrtxamltoolkit.$c$cplex.com/SourceControl/changeset/view/4d568d4e4c6a#WinRTXamlToolkit/Controls/InputDialog/InputDialog.cs"相对=nofollow> 显示InputDialog 在WinRT的XAML工具包的控制做到了这一点。它基本上是一个弹出式窗口控制文本框和一些按钮。有<一个href="http://winrtxamltoolkit.$c$cplex.com/SourceControl/changeset/view/4d568d4e4c6a#WinRTXamlToolkit.Sample/Views/Controls/InputDialogTestPage.xaml.cs"相对=nofollow>样本为它了。最基本的人做这样的:

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 09:46