Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在c metro应用程序的消息对话框中显示用户输入的文本框_C#_.net_Windows_Api_Messagedialog - Fatal编程技术网

C# 如何在c metro应用程序的消息对话框中显示用户输入的文本框

C# 如何在c metro应用程序的消息对话框中显示用户输入的文本框,c#,.net,windows,api,messagedialog,C#,.net,Windows,Api,Messagedialog,我想在我的消息对话框中显示一个文本框,以获取用户输入并单击“确定”按钮检索MainPage.cs中的文本框值 private async void join_btn_Click(object sender, RoutedEventArgs e) { var messageDialog = new MessageDialog(" Enter your secure code Here"); messageDialog.Title = "Join sess

我想在我的消息对话框中显示一个文本框,以获取用户输入并单击“确定”按钮检索MainPage.cs中的文本框值

  private async void join_btn_Click(object sender, RoutedEventArgs e)
    {
        var messageDialog = new MessageDialog(" Enter your secure code Here");
        messageDialog.Title = "Join session";
        messageDialog.Commands.Add(new UICommand(
            "OK",
            new UICommandInvokedHandler(this.CommandInvokedHandlerOKFunction)));

        messageDialog.DefaultCommandIndex = 0;
        messageDialog.CancelCommandIndex = 1;
        await messageDialog.ShowAsync();
    }

关于如何操作的任何建议???

您可以使用InputBox代替MessageDialog。在这里您可以获得文本框值。试试下面的代码

                string message, title, defaultValue;
                string myValue;
                message = "Enter Message Here :";
                title = "Title Name";
                myValue = Interaction.InputBox(message, title, defaultValue, 450, 450);
此myvalue字符串返回您在输入文本框中输入的值


我希望这会对你有所帮助。

这可能吗?????尽快回复开发者:我认为[来自此链接][1]的输入框是您所需要的。[1]: