Controlling display location of common dialogs

B

Bill Cernansky

I've been searching for days for an answer this question, including
usenet, the web, and through various books in my Safari subscription.
I'm desperate now, because all that searching turned up jack squat and
the deadline's approaching. I've not gotten answers on other newgroups
so here I am posting to another group.

I need to be able to control the location of OpenFileDialog and
SaveFileDialog windows. The system forces them into the center of the
screen, no matter what the screen configuration.

The app I've developed (entirely working except for this problem) needs
those dialogs in a specific place.

Is ethere anyone out there who has experience with this? In VB 6 it was
a cake walk. Not so in VB.NET.

Thanks for any help.
 
H

Herfried K. Wagner [MVP]

Bill Cernansky said:
I need to be able to control the location of OpenFileDialog and
SaveFileDialog windows. The system forces them into the center of the
screen, no matter what the screen configuration.

The app I've developed (entirely working except for this problem) needs
those dialogs in a specific place.

Is ethere anyone out there who has experience with this? In VB 6 it was
a cake walk. Not so in VB.NET.

You will have to utilize a Win32 dialog hook for this purpose. A VB6 sample
can be found here:

DialogPosition
<URL:http://dotnet.mvps.org/vb/samples/misc/DialogPosition.zip>
 
H

Herfried K. Wagner [MVP]

Bill Cernansky said:
I'll take a look, but hooking the API in VB6 and VB.NET, I have found,
is not the same.

It's not the same because you need to adapt function declarations etc.
<URL:http://www.pinvoke.net/> can be a valuable resource for this purpose.
 
B

Bill Cernansky

Thanks! Now I'm getting somewhere. Like I said, I don't want more than
the minimum required knowhow to get this working.

Really! Thanks again.
 

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