N
NevilleT
This shouldn't be so hard. So far I have been struggling for a day on it. I
want to provide an option to users to position a forms in either the top left
hand corner of their Access Window or in the centre of their Access window.
The users can make a selection on their switchboard depending on the screen
resolution they are using. For example, on 1280 x 1024 the screen would be
in the middle of their Access window. on a lower resolution - 1024 x 768 or
even 800 x 600 it is in the top left. Scrolling may be required to see the
whole screen on the rare monitor that is 800 x 600 .
To position at the top left is simple.
DoCmd.MoveSize 0, 0
To make this work the AutoCenter property needs to be set to No. I can only
reset AutoCentre to Yes in design mode. For this reason I cannot change the
AutoCenter property using VBA if the user selects "Form Centred".
I thought that since I know the form size in cms or twips, if I can
calculate the size of the Access Window, I can calculate where to position
the form using MoveSize. There is still the issue of regional settings as I
see MoveSize help tells me.
"Each measurement is in inches or centimeters, depending on the regional
settings in Windows Control Panel."
So far I have been Googleing the issue for hours and playing with pixels to
twips conversion (unsuccessfully). Stephen Lebans has a lot of related
information but I have not been able to pull the threads together. Can
anyone point me in the right direction? Maybe it is all just too hard and I
should forget it.
want to provide an option to users to position a forms in either the top left
hand corner of their Access Window or in the centre of their Access window.
The users can make a selection on their switchboard depending on the screen
resolution they are using. For example, on 1280 x 1024 the screen would be
in the middle of their Access window. on a lower resolution - 1024 x 768 or
even 800 x 600 it is in the top left. Scrolling may be required to see the
whole screen on the rare monitor that is 800 x 600 .
To position at the top left is simple.
DoCmd.MoveSize 0, 0
To make this work the AutoCenter property needs to be set to No. I can only
reset AutoCentre to Yes in design mode. For this reason I cannot change the
AutoCenter property using VBA if the user selects "Form Centred".
I thought that since I know the form size in cms or twips, if I can
calculate the size of the Access Window, I can calculate where to position
the form using MoveSize. There is still the issue of regional settings as I
see MoveSize help tells me.
"Each measurement is in inches or centimeters, depending on the regional
settings in Windows Control Panel."
So far I have been Googleing the issue for hours and playing with pixels to
twips conversion (unsuccessfully). Stephen Lebans has a lot of related
information but I have not been able to pull the threads together. Can
anyone point me in the right direction? Maybe it is all just too hard and I
should forget it.