Solved Positioning Access Dialogue Boxes (1 Viewer)

Jason Lee Hayes

Active member
Local time
Today, 18:44
Joined
Jul 25, 2020
Messages
175
Hi All,

Is it possible to control the position of a File Dialogue Box so that when opened it can be placed centrally on the screen?
I have searched but cannot find any resolve.. Just to be clear its not a form i am trying to centralise but the dialogue box or similar a system message.

It's a nicety not a necessity but my OCD flares up when i see the box popup and its not central.
I have noted that when it is invoked the File Dialogue box always comes up with a top left position same as my form i am evoking it from.
If this is always the case then the position must be linked to the form stats in which wondering if its possible to tap in here somehow maybe making use on API..

Thanks in advance...
 

Jason Lee Hayes

Active member
Local time
Today, 18:44
Joined
Jul 25, 2020
Messages
175

Jason Lee Hayes

Active member
Local time
Today, 18:44
Joined
Jul 25, 2020
Messages
175
Thanks theDBguy... Will take a look...
I think I've found what I'm looking for; just need to tap user32 library and make use of SetWindowsPos Function...

Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Thanks theDBGuy
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:44
Joined
Oct 29, 2018
Messages
21,449
I think I've found what I'm looking for; just need to tap user32 library and make use of SetWindowsPos Function...

Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Thanks theDBGuy
Congratulations!
 

isladogs

MVP / VIP
Local time
Today, 18:44
Joined
Jan 14, 2017
Messages
18,209
Hi All,

Is it possible to control the position of a File Dialogue Box so that when opened it can be placed centrally on the screen?
I have searched but cannot find any resolve.. Just to be clear its not a form i am trying to centralise but the dialogue box or similar a system message.

It's a nicety not a necessity but my OCD flares up when i see the box popup and its not central.
I have noted that when it is invoked the File Dialogue box always comes up with a top left position same as my form i am evoking it from.
If this is always the case then the position must be linked to the form stats in which wondering if its possible to tap in here somehow maybe making use on API..

Thanks in advance...
Perhaps you need to control your OCD! :giggle:
I really wouldn't bother! Once the File Dialog has been opened in the top left (default position), drag it to a new position. Next time you open it, that particular dialog box will open in the new position. However, other file dialogs will behave independently with the top left as default position in each case
 

Jason Lee Hayes

Active member
Local time
Today, 18:44
Joined
Jul 25, 2020
Messages
175
Perhaps you need to control your OCD! :giggle:
I really wouldn't bother! Once the File Dialog has been opened in the top left (default position), drag it to a new position. Next time you open it, that particular dialog box will open in the new position. However, other file dialogs will behave independently with the top left as default position in
 

Users who are viewing this thread

Top Bottom