MessageBox.Show() after FolderBrowserDialog doesn't get activated

M

Marcel Brekelmans

Hi,

I'm trying to display a MessageBox after a FolderBrowserDialog. I see that
it gets displayed, but not activated. The form is not in front and when I
have some other forms open the MessageBox is hidden behind them. The problem
seems to occur only after using the FolderBrowserDialog.

Has anyone seen this before?

Thanks
 
M

Marcel Brekelmans

I know the MessageBox.Show() has some overloads where you can set an
'IWin32Window owner' parameter. The MessageBox will then be shown in front
of that window. This seems to be the solution to my problem, but I can't
find a way to get the handle of the FolderBrowserDialog!
 
M

Marcel Brekelmans

Found it:

FolderBrowserDialog() also accepts an owner handle. Use the handle of the
form from which the FolderBrowserDialog is started, and also use this handle
in the MessageBox.Show() method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top