Solved

Determine screen coordinate position of upper left corner of window

Posted on 2007-11-15
8
1,091 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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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
 
LVL 119

Expert Comment

by:Rey Obrero
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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 119

Accepted Solution

by:
Rey Obrero 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now