views:

89

answers:

1

I am working on a wpf application. Here I need to use System.Windows.Forms.FolderBrowserDialog in my Wpf application.

        System.Windows.Forms.FolderBrowserDialog openFolderBrowser = new System.Windows.Forms.FolderBrowserDialog();

        openFolderBrowser.Description = "Select Resource Path:";
        openFolderBrowser.RootFolder = Environment.SpecialFolder.MyComputer;
        if (openFolderBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
        {
            //some logic
            openFolderBrowser.Dispose();
        }

I launch a FolderBrowserDialog, select a Folder and click OK, and then I launch another System.Windows.Forms.FolderBrowserDialog, My problem is when I select a Folder and click OK in this FolderBrowserDialog, the shadow of FolderBrowserDialog remains on the screen(means my screen doesn't refresh). I need to minimize or resize it in order to remove the shadow of FolderBrowserDialog. How can I solve this issue? Any help plz?

Edit:

I found the solution. I called OnRender method on my wpf Window and it worked for me. It redraws everythign on the screen.

A: 

You can call InvalidateVisual method to refresh UI.

In The Pink
Thanks, It gave me the way to solve my problem. I have updated the question with the way I solved my problem.
viky
OnRender will consume huge of CPU on my machine, I use this method after ShowDialog is return.
In The Pink