【问题标题】:windows 10 (modern) Universal app Platform (UWP) messagebox [duplicate]Windows 10(现代)通用应用平台(UWP)消息框[重复]
【发布时间】:2016-02-14 15:32:25
【问题描述】:

如何在 Windows 10(现代)通用应用程序平台 (UWP) 上制作消息框,就像在 Windows 经典表单 (messagebox.show) 上一样? 谢谢

【问题讨论】:

    标签: c# windows visual-studio-2015 win-universal-app


    【解决方案1】:

    对于通用应用,新的 API 要求您使用 await

    MessageDialog().ShowAsync() (in Windows.UI.Popups) 
    // to bring it into line with Win 8.1.
    
    var dialog = new MessageDialog("Your message here Hello");
    await dialog.ShowAsync();
    

    【讨论】:

      【解决方案2】:

      你可以这样做:

      var dialog = new MessageDialog("Your message here");
      await dialog.ShowAsync();
      

      【讨论】:

      • 它适用于windwos 10 last SDK?
      • 是的,确实如此......只需添加:使用 Windows.UI.Popups;
      【解决方案3】:
      var dialog = new MessageDialog("Hello World");
      await dialog.ShowAsync();
      

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-13
      • 1970-01-01
      • 1970-01-01
      • 2016-04-25
      • 2016-09-27
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      相关资源
      最近更新 更多