Alex,
Not sure what dialog you are using, but I use the following to locate stuff in a window (screen)
Screen Size Stuff:
Sysmetric(1) -> width of screen in pixels
Sysmetric(2) -> Height of Screen in pixels
FontMetric(1) -> Height of characters in pixels
FontMetric(6) -> Average width of characters in pixels
****************
Wait Window -> displays a small window with the text you put
The nowait option allows program execution to continue
The noclear option leaves the window on the screen until a Wait Clear
The coordinates are row and colum but are related to the screen resolution
Wait "Please Wait..." Window at 24,72 nowait noclear
Later to remove it...
Wait Clear
Putting the top left corner in the center of the screen...
Wait "Please Wait..." window at (sysmetric(2)/fontmetric(1))/2,;
(sysmetric(1)/fontmetric(6))/2
And to approximately center it, subtract half the size of the window...
Wait "Loading..." window at ((sysmetric(2)/fontmetric(1))/2) - 2,;
((sysmetric(1)/fontmetric(6))/2) - 8 nowait noclear
This is for a Wait Window, but you can use it for forms as well.
Sometimes I do this...
* Positioning a form at the mouse coordinates...
* create an array with amouseobj
amouseobj(mouseary)
* amouseobj creates an array elem 3 row, elem 4 col in pixels
* then in the form init, position it...
thisform.top = mouseary[4]
thisform.left = mouseary[3]
* and to make sure the form is not off the screen...
ntop = mouseary[4]
nleft = mouseary[3]
* make sure the form's right and bottom are not off the screen
* ntop = min( ntop, height of main form - height of this form)
* nleft = min( nleft, width of main form - width of this form)
thisform.top = min(mouseary[4],400)
thisform.left = min(mouseary[3],200)
Hope this is what you were looking for.
Ron Seidl
Independent Developer
VFP
"I'm playing in life's theater in anticipation of a great cast party!"