|
-
Feb 14th, 2003, 10:33 AM
#1
Thread Starter
Addicted Member
Find position of a form
Hey All,
I need to find the position of a form on the screen. I don't need
the exact position, just whether or not it is past 75% of the
screen width.
To be more specific, here is the situation...
I have a little form (100 x 100 pixels). At a given interval, the
form increases in size to 200 pixels wide. If the form is located
to the far right of the screen, the user will not be able to see the
whole form. I need to be able to find the form, and determine
if it is located past 75% of the screen width. If it is, then I will
need to move the form to the left, so when it expands to 200
pixels, the user will see the entire form.
I hope I explained this so everyone can understand it.
Thanks in advance,
Ron
-
Feb 14th, 2003, 10:44 AM
#2
PowerPoster
check out the form's "top" and "left" properties
-
Feb 14th, 2003, 11:30 AM
#3
Thread Starter
Addicted Member
The reason I was wanting to work with percentages was so it
would work with all screen resolutions.
-
Feb 14th, 2003, 11:33 AM
#4
The reason I was wanting to work with percentages was so it
would work with all screen resolutions.
erm, that's backwards... if you are working with percentages it will be far less accurate.
Try:
If Me.Left + Me.Width > Screen.Width Then Me.Left = Screen.Width - Me.Width
It should be perfect for every screen resolution, and whatever the size of the form currently is
-
Feb 14th, 2003, 12:41 PM
#5
PowerPoster
The reason I was wanting to work with percentages was so it would work with all screen resolutions.
if you are unable to move from absolutes to percentages, I suggest you dust off your high school algebra book.
-
Feb 14th, 2003, 01:02 PM
#6
Thread Starter
Addicted Member
Hey Guys,
The code si_the_geek gave worked fine. Simple, and to the
point.
Thanks for all the input,
Ron
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|