Windows phone 7 在windows phone中更改消息框按钮的名称

Windows phone 7 在windows phone中更改消息框按钮的名称,windows-phone-7,messagebox,Windows Phone 7,Messagebox,我想更改应用程序中出现的消息框按钮中的文本。 例如,我想用“照相机”代替“是”,我想用“媒体库”代替“否”…有人知道吗 这就是我能走多远 DialogResult dlgResult=MessageBox.ShowInport photo,选择从何处导入照片,MessageBoxButtons.YesNo,MessageBoxIcon.None 我非常努力,任何想法都欢迎。 谢谢默认的Silverlight API不允许您这样做,但是XNA API允许您这样做。请参阅以下链接: 默认的Silve

我想更改应用程序中出现的消息框按钮中的文本。 例如,我想用“照相机”代替“是”,我想用“媒体库”代替“否”…有人知道吗

这就是我能走多远

DialogResult dlgResult=MessageBox.ShowInport photo,选择从何处导入照片,MessageBoxButtons.YesNo,MessageBoxIcon.None

我非常努力,任何想法都欢迎。
谢谢

默认的Silverlight API不允许您这样做,但是XNA API允许您这样做。请参阅以下链接:


默认的SilverlightAPI不允许您这样做,但是XNAAPI允许。请参阅以下链接:


无法更改MessageBox的默认按钮。更好的是,您可以在Microsoft Phone Toolkit中使用所需的左右按钮创建自定义消息框,还可以设置单击这些按钮时的功能

要下载NuGet,请点击此处。在您的项目中,按左键单击,然后管理NuGet软件包并搜索Microsoft Phone Toolkit。找到软件包后,只需按install,然后使用下面的代码

CustomMessageBox messageBox = new CustomMessageBox()
        {
            Title = "Inport photo", //your title
            Message = "Select from where to import photo", //your message
            RightButtonContent = "Yes", // you can change this right and left button content
            LeftButtonContent = "No",
        };

        messageBox.Dismissed += (s2, e2) =>
        {
            switch (e2.Result)
            {
                case CustomMessageBoxResult.RightButton:
                    //here your function for right button
                break;
                case CustomMessageBoxResult.LeftButton:
                    //here your function for left button
                break;
                default:
                break;
            }
        };

        messageBox.Show();

无法更改MessageBox的默认按钮。更好的是,您可以在Microsoft Phone Toolkit中使用所需的左右按钮创建自定义消息框,还可以设置单击这些按钮时的功能

要下载NuGet,请点击此处。在您的项目中,按左键单击,然后管理NuGet软件包并搜索Microsoft Phone Toolkit。找到软件包后,只需按install,然后使用下面的代码

CustomMessageBox messageBox = new CustomMessageBox()
        {
            Title = "Inport photo", //your title
            Message = "Select from where to import photo", //your message
            RightButtonContent = "Yes", // you can change this right and left button content
            LeftButtonContent = "No",
        };

        messageBox.Dismissed += (s2, e2) =>
        {
            switch (e2.Result)
            {
                case CustomMessageBoxResult.RightButton:
                    //here your function for right button
                break;
                case CustomMessageBoxResult.LeftButton:
                    //here your function for left button
                break;
                default:
                break;
            }
        };

        messageBox.Show();