如何在WindowsPhone7的MessageBox中添加TextBox



这里我需要将文本框添加到消息框。但是消息框没有添加文本框,我如何添加它

除非Phone不同,否则消息框通常不支持自定义控件-它们有固定控件。您可能需要创建自己的小表单。你试过什么代码?

您可以使用Coding4Fun Windows Phone Toolkit。
它们具有控件输入提示,该控件显示带有文本框的消息框。

如果您只需要像Visual Basic中那样的简单InputBox,则可以使用Microsoft.Xna.Framework.GamerServices中的Guide.BeginShowKeyboardInput方法来显示请求用户输入的TextBox。

像这样使用:

Guide.BeginShowKeyboardInput(PlayerIndex.One, "caption", "text", "defaultText", ar =>
{
    text = Guide.EndShowKeyboardInput(ar);
    //Do something with the text here!
}, null);

如果您在应用程序中使用MVVM体系结构,您也可以在Cimbalino Windows Phone Toolkit上使用InputBoxService,以获得更清洁的方法!

最新更新