I have searched several postings with similar questions but have not found a response that works. You would think that it would be fairly simple to center the content of a form on the screen (regardless of size and resolution) but that does not seem to be the case. Auto Center set to Yes does not work. I am running XP and Access 2007. Any help would be most appreciated. Thanks!
How to center content of a form on screen? Auto Center does not work.
Collapse
X
-
-
Are you centering within the application (Access) or the screen?- If the former, then I've only noticed problems when switching from Design View, so if this is what you're noticing try closing the form completely then opening it again from scratch. It should work.
- If the latter, then to expect this to be straightforward shows a certain lack of understanding as to what's what. A form is an object that is within the application. Positioning of this object is always relative to the application window, indeed any part of the object that protrudes beyond the application window is clipped.
With that in mind (obviously it cannot be centred at all in the screen unless that part of the screen is already taken up by the application window) it is possible to centre the form within the screen. It would involve getting the screen co-ordinates of the application window and doing some math to determine where it should be placed within that to have the effect of being centred in the screen. The maths are pretty straightforward , but I'm afraid I don't know the system function call required to find the co-ordinates of the application window. That information's out there though, if you look.
Welcome to Bytes! -
Center within application
I should probably provide more detail. I am using the tabbed documents option within the Access application. When I have a form that does not stretch across the entire viewable area of the screen/application (sorry if I am not using terms correctly), I would like for it to be centered within the tabbed form (horizontally not vertically). Even with Auto Center set to yes, it always appears left alligned with a great deal of empty white space to the right of the form. Are there other settings I am missing to get the Auto Center to work?
ThanksComment
-
I'm not very familiar with the AutoCentre property, but I think it works only for freestanding forms. When a form is used within another form or report (in a SubForm control) then the positionning is specified explicitly in the design.
You can either design the form (SubForm etc) to position it where you want it, or you can set the left position in code after the main form has been loaded.Comment
Comment