473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Detecting form going off edge of screen


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
2 3798
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kiteman - Canada | last post by:
Is there an event triggered when a form is dragged by its titlebar? I have two forms on screen - the main form is draggable and I need the secondary form to automatically reposition itself...
1
by: guy | last post by:
Hi! we design forms in size of 800,600 because this is the size of our clients screen, the problem is that i can maximize the form from the control box or double click on the top border,to the...
27
by: Deek | last post by:
I have a target(graphic) that moves via, i am trying to detect a hit of the target with and essay(copied below) my prof gave us, but I am not sure what to do, if you could get me going in the...
4
by: kaosyeti | last post by:
what's the best way to get a form to always open at a specific size. i've sized and saved the forms, changed the borders and had popup on and off all over but can't seem to get it to stay one way...
4
by: gsb58 | last post by:
Hi! On a form I have a calendar. The form is rezised to 1024x768 (Don't worry - this is a training case) when loaded. Now I want to center the calendar on the form so that its edges are...
0
by: zbud | last post by:
I have a form that is in the correct position in design view. (although I notice there are horz and vert scroll bars in the design window even though the form is smaller than the screen size)...
0
by: zbud | last post by:
I have a form that is in the correct position in design view. (although I notice there are horz and vert scroll bars in the design window even though the form is smaller than the screen size)...
3
by: wavedave | last post by:
Hello everyone - I'm trying to build a .NET application (C#) in which my program acts as an add-on to another existing application, providing some additional functionality. The way I want the UI...
3
by: Andrew Hall | last post by:
Hi all Can anyone advise how to get the position of an open form and how to set the position of an opening form within the access window. I have: MA Access97 (because I do not have the funds...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.