Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What to Setup Menus to be Maximized and Centered

Status
Not open for further replies.

davesaint86

IS-IT--Management
Aug 23, 2007
10
0
0
US
Is there a way to setup menus to open up maximized and have the menu centered (middle top of screen) no matter what type of monitor you use?
 
Yes. Well, kind of.. almost...But I don't know what you mean by Maximizing a menu - ..to me, a menu is a one-line, rather horizontally oriented object of a fixed height. In which direction would you "maximize" a menu?

There are a couple of guys that contain the current form's height and width, and you can use them, in concert with a control's height and width, to center something.

Screen.ActiveControl.Width
Screen.ActiveForm.Width

Thus, if you take 1/2 of the Screen.ActiveForm.Width, you'll know where the center of the form is. Then set the LEFT of the control you want centered to the Form width divided by 2 minus the control width divided by 2...

Control.Left = (FormWidth/2) - (ControlWidth/2)

But we have issues such as maximized forms within an access window, versus a maximized Access window itself, etc etc etc.

It is possible to CENTER a form whenever it opens that will be centered respective to the Access child window, not the visual screen. But the centering is both horiz. and vert.

If you have an open form, and you wish it to reopen in the same spot every time, open it in FORM VIEW and press CONTROL-S. This will save not only the form contents, but it's size and location as well. Next time you open, it'll be right where it was, so long as you have not set its AUTOCENTER property to YES.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top