FolderBrowserDialog - Win32Exception occurred - The parameter is incorrect

前端 未结 3 2141
再見小時候
再見小時候 2021-02-14 23:09

I try to use the FolderBrowserDialog from WPF like this:

public static bool BrowseFolder(out string folderName)
{
   using (System.Windows.Forms.FolderBrowserDia         


        
3条回答
  •  时光取名叫无心
    2021-02-15 00:15

    This is just a bit of interop nastiness. The WPF code tries to set the focus back to the main window when the dialog is closing. Problem is, the dialog has disabled the window so it can't receive the focus yet. WPF is too eager to change the focus and doesn't otherwise know anything about the dialog behavior. Nothing actually goes wrong.

提交回复
热议问题