OpenDialog for WPF

可紊 提交于 2019-11-30 21:33:47

问题


I just started with WPF. Moved from Window Form.

Where do those openDialog, saveDialog gone? And a bunch of stuff.


回答1:


Look in Microsoft.Win32 namespace

OpenFileDialog openDialog = new OpenFileDialog();
if (openDialog.ShowDialog().Value)
{
      ..........
}

And the same for SaveFileDialog

SaveFileDialog saveDialog = new SaveFileDialog();
if (saveDialog.ShowDialog().Value)
{
      ..........
}


来源:https://stackoverflow.com/questions/1339783/opendialog-for-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!