By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Detecting form going off edge of screen

P: n/a

Does anyone have any suggestions on this? I have a form that can be
collapsed into a compact size and expanded back to full size. If the
user moves the compact size of the form close to the edge, then when it
is brought to full size, the right edge goes off the edge of the screen.
How can I code to adjust for this? If I code for checking for the
left edge and the size and being a certain distance from the right edge
of the screen, then it will only work for my current screen settings.
What if another user has different screen settings? Would I need to
have code to check the screen settings, or is there a better way to do
this? Thanks.
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can get the screen size from the Screen object and develop a general
formula for setting the left and top of your form when is is resized in the
onsizechange event.

"copyco" wrote:

Does anyone have any suggestions on this? I have a form that can be
collapsed into a compact size and expanded back to full size. If the
user moves the compact size of the form close to the edge, then when it
is brought to full size, the right edge goes off the edge of the screen.
How can I code to adjust for this? If I code for checking for the
left edge and the size and being a certain distance from the right edge
of the screen, then it will only work for my current screen settings.
What if another user has different screen settings? Would I need to
have code to check the screen settings, or is there a better way to do
this? Thanks.

Nov 21 '05 #2

P: n/a
Wow. I did not know there was a Screen object. Thanks, I got it.

If Me.Left + Me.Width > Screen.PrimaryScreen.Bounds.Right() Then
Me.Left = Screen.PrimaryScreen.Bounds.Right - Me.Width
End If
Dennis wrote:
You can get the screen size from the Screen object and develop a general
formula for setting the left and top of your form when is is resized in the
onsizechange event.

"copyco" wrote:

Does anyone have any suggestions on this? I have a form that can be
collapsed into a compact size and expanded back to full size. If the
user moves the compact size of the form close to the edge, then when it
is brought to full size, the right edge goes off the edge of the screen.
How can I code to adjust for this? If I code for checking for the
left edge and the size and being a certain distance from the right edge
of the screen, then it will only work for my current screen settings.
What if another user has different screen settings? Would I need to
have code to check the screen settings, or is there a better way to do
this? Thanks.


--

Confucious say: "He who stands on toilet is high on pot."
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.