当前位置:网站首页>WPF 选择文件夹
WPF 选择文件夹
2022-06-21 20:41:00 【zLulus】
效果如图
使用FolderBrowserDialog
System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
System.Windows.Forms.DialogResult result = dialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
selectFolrderPathTextBlock.Text = dialog.SelectedPath.Trim();
使用FolderBrowserDialog
//引用WindowsAPICodePack
var dialog = new CommonOpenFileDialog();
dialog.IsFolderPicker = true;
CommonFileDialogResult result = dialog.ShowDialog();
if (result == CommonFileDialogResult.Ok)
{
selectFolrderPathTextBlock.Text = dialog.FileName;
}
示例代码
参考资料
边栏推荐
- Nacos安装指南
- Leetcode question brushing: SF Technology Smart logistics Campus Technology Challenge
- GDB debugging practice (7) signal processing
- 关于lg(n!)的渐进紧确界
- tkinter中text文本与scroll滚动条关联
- Common abbreviations and terms of mitochondrial genome
- Technology sharing | mysql:caching_ sha2_ Password quick Q & A
- Technology sharing | introduction to kubernetes pod
- Technology sharing | a clustering incremental statistical SQL requirement in MySQL
- Lifting method (I) AdaBoost
猜你喜欢

js 监听和移除监听事件

Dotter| dot method sequence pairwise comparison software

Notes on topic brushing (16) -- binary tree: modification and construction

Summary of Li Kou brush questions 4 (MySQL version)

迅为iTOP-3568开发板安装 RKNN Toolkit Lite2

更好的管理各种音乐,专业的DJ音乐管理软件Pioneer DJ rekordbox

【深入理解TcaplusDB技術】TcaplusDB構造數據

Introduction to software architecture

How C # aboutbox displays its defined interface

HIC Pro | HIC data processing tool
随机推荐
GDB debugging practice (7) signal processing
Notes on topic brushing (16) -- binary tree: modification and construction
电脑屏幕分辨率怎么调?电脑屏幕修改分辨率SwitchResX
js 监听和移除监听事件
UWP 手写板InkCanvas
翻译软件Bob安装教程
类库、框架、模块、组件等概念介绍
利用do while循环,分别计算1-100中奇数的和、偶数的和【方法二】
[deeply understand tcapulusdb technology] tmonitor module architecture
UEFI 双系统+双硬盘安装
[deeply understand tcapulusdb technology] tmonitor background one click installation
【LeetCode】8、字符串转换整数(atoi)
Pal2nal| how to run pal2nal from the command line
秒懂微服务
技术分享 | kubernetes pod 简介
软件测试----测试的分类
An example of CPU instruction rearrangement leading to errors
pi4j gpio针脚上拉电阻,下拉电阻概念
Use for, while and do while to find the sum of 1-100 circularly
Introduction to software architecture