[英]Is it possible to set FolderBrowserDialog.SelectedPath with “..//..//FolderName” in C#?
[英]FolderBrowserDialog C# SelectedPath always displayed at bottom
我通過以下方式打開 FolderBrowserDialog:
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = desc;
fbd.SelectedPath = defaultPath;
fbd.ShowNewFolderButton = showNewFolderButton;
DialogResult result = fbd.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
return fbd.SelectedPath + @"\";
else
return "";
這行得通。 但是每次我 select 在此對話框中創建一個新文件夾時,整個“文件夾樹”都會向下滾動到底部,以便所選文件夾位於 FolderBrowserDialog 的底部。 這變得非常煩人,因為我總是不得不再次向下滾動到 select 另一個文件夾......
有什么解決辦法嗎?
謝謝!
我能夠重現您在 Windows 7 中看到的內容。不過這只是第一次發生。 因此,如果您壓縮展開的文件夾並再次嘗試單擊它,它不會將所選文件夾向下移動,而是保留在原處並展開其下的子文件夾。 如果我們使用箭頭 cursor 展開文件夾,則不會發生這種情況。 有時我看到所選文件夾甚至向上移動以顯示所有內容。 這可能是設計使然或一個小錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.