Solved

Determine screen coordinate position of upper left corner of window

Posted on 2007-11-15
8
1,093 Views
Last Modified: 2012-08-14
Is there a method using VB to determine the position on an Access(2002-2003) form at the upper left corner of the form window?  I need this information for cases where the window is sized smaller than the size of the form (scroll bars are present) and the user has adjusted the vertical/horizontal scrollbar position.

Any method for determing the area of the form contained within the current window would be helpful.

Thanks,

Craig Harrington
0
Comment
Question by:cnharrington
  • 4
  • 4
8 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20292045
0
 

Author Comment

by:cnharrington
ID: 20292772
Hello Capricon1

Thanks for the reply.  I reviewed the links that you provided and it seems they solve a problem of rescaling a form and its controls to fit a new window size.  My problem is somewhat different in that I am trying to position certain form objects based on a knowing what portion of the form is being viewed in the current window.

I have attached a screenshot to help clarify my problem.
https://filedb.experts-exchange.com/incoming/ee-stuff/5635-Example.JPG

Thanks for your help

Craig Harrington

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20292903
i don't exactly understand what you want to do, but to position a form when it opens you can use this

docmd.MoveSize right,down,width,height  

values in twips
1 inch=1440 twips

also see this link

http://support.microsoft.com/?kbid=210141
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20292922
you can start with
docmd.movesize 0,0

the right and down values determines the position of the upper left corner of the form with respect to the  access window
0
 

Author Comment

by:cnharrington
ID: 20293240
I understand how to locate/move the control.  But before I can position a control I must understand where my view is positioned on the form.  I need to determine where the user has "scrolled" within the current window to view a certain portion of the form (similar to my example screen shot).

I was hoping to be able to locate the current view by understanding the relative location of this view with respect to the form.  Alternatively, if I could understand to current scroll position then I could then I could compute the form position.

Does this explain my issue better?

Thanks for the help.

Craig
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 20293779
sorry, but ....

from the link i posted above

MORE INFORMATION
In Microsoft Access, you can use the WindowWidth and WindowHeight form properties to determine the current width and height of the window that a form is contained in.
********* However, there are no properties to determine the window's right and down measurements (these measurements are commonly used in the MoveSize macro action to position a form window). ********

The right and down measurements, along with the width and height, are useful if you want to position a form side-by-side with another form. The following examples show you how to create and use the GetFormDimensions Sub procedure to get these measurements and to use them to position a form to the right of, and then below, another form by using the MoveSize macro action.

0
 

Author Comment

by:cnharrington
ID: 20293955
I was hoping to find a simplier VBA based method rather than direct API calls but if that's the only way.

Thanks for your efforts.

Craig
0
 

Author Comment

by:cnharrington
ID: 20294540
I was able to drop-in the MS Support code quite easily.  It works fine.

Thanks again.

Craig
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question