מעכשיו פוסטים חדשים מ-Usenet לא יופיעו ואי אפשר להירשם לתוכן מ-Usenet בקבוצות Google. התוכן שכבר פורסם עדיין יופיע.

Why doesn't autocenter center the form?

1,425 צפיות
מעבר להודעה הראשונה שלא נקראה

Bortmas

לא נקראה,
14 במרץ 2002, 16:06:5514.3.2002
עד
I have a standard form size of 4.5" Height by 7" width. I use this size for
many forms. I set the form's properties to autocenter=yes and autoresize=no.

My problem is that some of the forms open in a position where the top of the
form is over the tool button bar and menu bar of the main access window.
Others do center themselves within the access window. What causes the
difference? Is there some other factor that affects what centered means or
what size it thinks the form is?

The form positions are consistent. The same forms open in the same positions.

I am using Access97. Thanks in advance for any clues.

Thanks in advance.

Bruce M. Thompson

לא נקראה,
14 במרץ 2002, 20:30:1514.3.2002
עד
> My problem is that some of the forms open in a position where the top of the
> form is over the tool button bar and menu bar of the main access window.

Would those forms happen to have their "PopUp" property set to "Yes"?
--
Bruce M. Thompson, Microsoft Access MVP
bthmpson@big~SPAM_NOT~foot.com
>>No Email, Please. Keep all communications
within the newsgroups so that all might benefit.<<


Bortmas

לא נקראה,
15 במרץ 2002, 12:53:0215.3.2002
עד
In answer to Bruce's question - I don't know, but maybe.

My forms properties are popup= no, but I think it gets changed.

The switchboard form when it opens during startup is centered. Then windows
opened from it are in a slightly higher position in the window. The
switchboard calls macros which open the forms in dialog mode and I'll bet that
switches the pop-up setting.

Now if this is true - then why aren't they all still autocentered?

Thanks,
Jim

In article <H8ck8.317$iV4.2...@monger.newsread.com>, "Bruce M. Thompson"
<NO~SPAM_b...@bigfoot.com> writes:

Bruce M. Thompson

לא נקראה,
15 במרץ 2002, 13:37:0315.3.2002
עד
Yes, dialog mode would make a form's "PopUp" property "True". Those forms that
are not "PopUp" take into account the toolbars, menus, etc. when centering (it
centers inside the MDI window) - the "PopUp" forms center in the screen and do
not take into account the toolbars, menus, etc..

--
Bruce M. Thompson, Microsoft Access MVP
bthmpson@big~SPAM_NOT~foot.com
>>No Email, Please. Keep all communications
within the newsgroups so that all might benefit.<<

"Bortmas" <bor...@aol.comnospam> wrote in message
news:20020315125302...@mb-fj.aol.com...

Bortmas

לא נקראה,
16 במרץ 2002, 11:05:2416.3.2002
עד
If autocenter varies the position of the centering action depending on
different window properties then what is the best way to position forms in the
same spot each time - regardless of which mode.

I tried the macro method to position the window with the movesize action. But
it was even less consistent than autocenter. It moved the windows but they
rarely moved to the same positions as another form running the same macro.

Thanks,
Jim

Bruce M. Thompson

לא נקראה,
16 במרץ 2002, 17:45:3016.3.2002
עד
Jim:

First of all, make sure that "Autocenter" is set to "Yes" in all the forms that
you want to position. In a global module (a module that is NOT behind a form),
declare this API function (watch line wrap, it's all on one line so copy and
paste it and remove the carriage return):

'****************Between these lines is all on one line
Public Declare Function IsChild Lib "user32" (ByVal hWndParent As Long, ByVal
hwnd As Long) As Long
'****************

Then, in each form's "OnOpen" event procedure, add the following sample code:

'****************SAMPLE CODE START
If IsChild(Application.hWndAccessApp, Me.hWnd) Then
'Form is NOT in "PopUp" or "Dialog" mode
' so let autocenter position form
Else
'Form IS in "PopUp" or "Dialog" mode
DoCmd.MoveSize , 1.5 * 1440
End If
'****************SAMPLE CODE END

In the sample code above, you will need to change the "1.5" value in order to
get the vertical position right for the form when it is open via your
switchboard. Increase it to move the form down, and decrease it to move the form
up.

What the sample code does is to check to see if the form's "window" is a child
of the Access window (if a form is opened normal, it is a child of the Access
MDI, if it is opened "PopUp" or "Dialog", it is not) and positions the form
accordingly.

--
Bruce M. Thompson, Microsoft Access MVP
bthmpson@big~SPAM_NOT~foot.com
>>No Email, Please. Keep all communications
within the newsgroups so that all might benefit.<<

"Bortmas" <bor...@aol.comnospam> wrote in message

news:20020316110524...@mb-fe.aol.com...

0 הודעות חדשות