How do I open a FolderBrowserDialog at the selected folder?

后端 未结 9 1916
深忆病人
深忆病人 2020-12-15 18:00

I have a FolderBrowserDialog, displayed with code shown below. However, it keeps opening with \'Computer\', i.e. the root of the folder tree, selected. How do I get it to

9条回答
  •  一个人的身影
    2020-12-15 18:25

    Set rootfolder to

    Environment.SpecialFolder.Desktop
    

    and it should work as you want.

    It is the only way to actually set the initial selected folder. You'd think using

    Environment.SpecialFolder.MyComputer
    

    would work, but it doesn't.

提交回复
热议问题