在WPF中调用打开文件对话框
2014-10-06 14:44
288 查看
// Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.DefaultExt = ".txt"; dlg.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif"; // Display OpenFileDialog by calling ShowDialog method Nullable<bool> result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { // Open document string filename = dlg.FileName; this.txtPlace.Text = filename; }
Using Open File Dialog in WPF
相关文章推荐
- 调用系统控件,打开选择文件或路径的对话框
- 调用打开文件的对话框
- 打开和保存文件对话框 调用动态库
- 用flash调用VC打开文件对话框,取得路径。
- 一个Win32SDK的通用的打开、保存文件的对话框的调用
- 打开和保存文件对话框 调用动态库
- 调用系统通用对话框打开文件/文件夹
- MFC调用打开文件、文件夹对话框
- [WPF Bug清单]之(3)——暗中创建文件的打开文件对话框
- 调用IE内部命令实现文件打开、保存对话框
- Unity调用Win32的打开和保存文件对话框
- win32api调用打开/保存文件对话框
- VC++中打开文件和保存文件对话框的调用
- Mac 调用打开文件对话框 NSOpenPanel
- 用VC 6.0写flash播放器——1、在VC 6.0中调用打开文件对话框
- Win32 api使用中调用GetOpenFileName打开文件对话框无响应的解决方法
- 如何在代码中调用“文件打开方式对话框”?
- WPF 打开文件 打开路径对话框
- Vb中不用控件调用文件打开对话框
- wpf "打开文件"对话框(OpenFileDialog)的小笔记