AutoCenter doesnt work

acidtechno

New member
Local time
Today, 14:56
Joined
May 24, 2007
Messages
9
I have a very small form (Dialog) without any buttons and I'm using it to show the information that database is processing something.

I set AutoCenter to Yes and it centers it horizontally but not vertically. It's positioned at about 30% of the screen. Very strange. Is it normal? Or maybe there is a way to manually set the position of a form in the runtime (without using W32 API)?
 
Weird, because I couldnt find anything about positioning the window vertically. Thanks anyway.
 
i didn't know that it's only horizontal. that would explain some weirdness.

i'm quite sure you can position a form anywhere, but only in pixels [edit: not pixels, twips] so that's only useful if you always know the screen size. (it's something like MoveSize (?)).
 
Last edited:
Well, basically that's what I'm looking for. If there's possibility to manually specify the position of that form during runtime, that would solve my problem. But I cant find any function that does it.
 
MoveSize Method

Specifics
The MoveSize method carries out the MoveSize action in Visual Basic.

expression.MoveSize(Right, Down, Width, Height)
expression Required. An expression that returns one of the objects in the Applies To list.

Right Optional Variant. A numeric expression.
Down Optional Variant. A numeric expression.
Width Optional Variant. A numeric expression.
Height Optional Variant. A numeric expression.

Remarks
For more information on how the action and its arguments work, see the action topic.

You must include at least one argument for the MoveSize method. If you leave an argument blank, the current setting for the window is used.

You can leave an optional argument blank in the middle of the syntax, but you must include the argument's comma. If you leave one or more trailing arguments blank, don't use a comma following the last argument you specify.

The units for the arguments are twips (twip: Unit of measurement that is equal to 1/20 of a point, or 1/1,440 of an inch. There are 567 twips in a centimeter.).

Example
The following example moves the active window and changes its height, but leaves its width unchanged:

DoCmd.MoveSize 1440, 2400, , 2000

see: vba help.
 
MoveSize is a real mare's nest! If you follow the link in BobLarson's post, and look for my post there, you'll find the easiest way to do this! You simply position it manually, as you suggested, but you have to follow a certain set of steps to save it in that position.

Good Luck!

MissingLinq
 
Hi,

Make sure that your Window XP Display Properties is set correctly.

The Default Setting is "Normal Size (96DPI)". If you selected Large or Custom, maybe that's why it's not centred?

I have a very small form (Dialog) without any buttons and I'm using it to show the information that database is processing something.

I set AutoCenter to Yes and it centers it horizontally but not vertically. It's positioned at about 30% of the screen. Very strange. Is it normal? Or maybe there is a way to manually set the position of a form in the runtime (without using W32 API)?
 
It's not centered because, as RuralGuy has already said, "autocenter is *only* horizontal!"
 
Hi missinglinq,

I have seen such complaints before.
Access 97 and 2000 works well at 800x600. If you designed the forms on a computer with a resolution of 800x600 and copy this database into a computer with a higher resolution of 1024x768. You'll see that your forms will not be centred. If the form's properties is set to "Auto Centre = Yes", the popup from will not be centred, it will be horizontally centred above the center point of your monitor.

For people of vision impaired, sometimes user set the windows display DPI setting higher. So you end up with a form not centred.

It's not centered because, as RuralGuy has already said, "autocenter is *only* horizontal!"
 
It looks like Access has very poor window management. Unlike Excel, there is no .Left or .Top property and MoveSize is quite limited.

Anyway I've done what I needed using Win32 API. VBA sucks :(
 

Users who are viewing this thread

Back
Top Bottom