Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Lock command buttons in place

Posted on 2013-02-02
10
Medium Priority
?
318 Views
Last Modified: 2013-02-07
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
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 31

Expert Comment

by:hnasr
ID: 38846659
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
 

Author Comment

by:SteveL13
ID: 38846714
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
 
LVL 31

Expert Comment

by:hnasr
ID: 38846729
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
Technology Partners: 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!

 

Author Comment

by:SteveL13
ID: 38846750
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
 
LVL 40

Expert Comment

by:als315
ID: 38846856
You should not center your picture. Access buttons can't follow this centering.
picture
0
 
LVL 31

Expert Comment

by:hnasr
ID: 38847127
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
 

Author Comment

by:SteveL13
ID: 38847367
Sorry... still not understanding.  What does the CAForm represent?
0
 
LVL 31

Expert Comment

by:hnasr
ID: 38847606
This is control name.
check the database Form_Open event.
Example-Q-28017794.accdb
0
 

Author Comment

by:SteveL13
ID: 38849196
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
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 38853594
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

618 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