FolderBrowserDialog opening behind active application

S

Scott M. Lyon

My application (a VB.NET 2003 WinApp) currently has first an OpenFileDialog
(asking for an input file to the process I'm working on), and then once the
user selects that, it brings up a FolderBrowserDialog box (asking for a
destination for the output files from the process to be saved).


The OpenFileDialog works beautifully.


The problem is, after the user selects the input file from the
OpenFileDialog, when it opens the FolderBrowserDialog, it opens up behind
the application, and the user has to alt-TAB to get to it.


How can I force the FolderBrowserDialog to come to the front (at least
initially - if they choose to click on another application, I don't mind it
going behind then)?


Thanks!
-Scott
 
C

Carlos J. Quintero [VB MVP]

Are you using the overloaded ShowDialog function that receives the parent
IWin32Window?

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
S

Scott M. Lyon

Ah, that might be it. No, I was using the ShowDialog function that doesn't
pass any parameters.


I'll try the other, and see if that works better.


Thanks!
-Scott
 
S

Scott M. Lyon

This is probably a stupid question, but here goes anyways:

The code for calling the ShowDialog function is in the code behind my main
form. How do I determine the IWin32Window value for the calling form?


Thanks!
-Scott
 
C

Carlos J. Quintero [VB MVP]

I am not sure if I understand the question, but the
System.Windows.Forms.Form class already implements the IWin32Window
interface, so you only need to pass the form that is showing the dialog.


--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 

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