[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

Lock command buttons in place

I have a form with a background photo. The form has command buttons that are positioned in place relative to elements in the background picture.  They stay where I want them on my monitor but if I run the program on various monitors they don't stay in place.

Has any one had experience with this and have a solution?
0
SteveL13
Asked:
SteveL13
1 Solution
 
hnasrCommented:
Form properties:

Me.WindowWidth
Me.WindowLeft
Me.WindowWidth
Me.WindowHeight

You use these values to calculate Button.Left, Button.Top.
For example: Me.Button1.Left=Me.WindowWidth/10  ' starts at the first 1/10the size of the form
                      Me.Button1.Top=Me.WindowHeight/10
0
 
SteveL13Author Commented:
Hmmm..not sure I understand.

My picture is in the detail section of the form.  The detail section is 6.625" height and 9" width.

All of the buttons are 1" wide x .3333" height.

The first one for example is positioned at .875 top and .3021 left.

How to I alter your code to do what you are telling me?
0
 
hnasrCommented:
Try to create a simple form with a picture and 2 buttons.
Tell me when I run the form: What to look for and what to expect and what to modify.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SteveL13Author Commented:
Please see the attachment.  As you can see there are buttons, (actually they are labels with on click events that won't work in this example because thaere are no back end tables).

The "buttons" need to line up with the picture.  I've also included a snapshot of the form as it appears on my monitor and as I want it to appear on any monitor.

--Steve
Example.accdb
snapshot.jpg
0
 
als315Commented:
You should not center your picture. Access buttons can't follow this centering.
picture
0
 
hnasrCommented:
Try aligning buttons to respective labels on open event of form.

Private Sub Form_Open(Cancel As Integer)
    Me.CAForm.Left = Me.Label80.Left
    Me.CAForm.Top = Label80.Top + Me.Label80.Height
    'repeat for other buttons with respective labels
End Sub

Open in new window

0
 
SteveL13Author Commented:
Sorry... still not understanding.  What does the CAForm represent?
0
 
hnasrCommented:
This is control name.
check the database Form_Open event.
Example-Q-28017794.accdb
0
 
SteveL13Author Commented:
I don't think this is working.  I can see how we can set the position of a label relative to another label.  But I don't how we're telling the form where to set, for example, the upper left label to the position of the background picture when the background picture is going to change depending on the resolution of the monitor.

Am I wrong?
0
 
Jeffrey CoachmanCommented:
This is the problem with trying to do things like this.
It is a nightmare trying to adjust the "screen" positions of a control based on image that will distort/skew for each users resolution.
It can be done, but rarely worth the trouble IMHO.

Not only the position, ...but the relative "size" of the control may also need to be adjusted...
(a control that is a good size at 800x600 may be too small at 1280X1024, or even smaller on some hi-res/wide screen resolutions)

Perhaps a utility like this is your best shot:
http://www.peterssoftware.com/ss.htm


JeffCoachman
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now