?
Solved

VB Label Placement Question

Posted on 2011-10-31
5
Medium Priority
?
291 Views
Last Modified: 2012-08-14
I am using a Label to display my copyright at the bottom of my Form.

Me.Left = (Screen.Width - Me.Width) /2
Me.Top = (Screen.Height - Me.Height) /2

Copyright_lbl.left = (Screen.Width - Copyright_lbl.Width) / 2
Copyright_lbl.Top = Screen.Height - 1350

The -1350 puts the Label just above the Windows Start button..
If it is on the side or uses the auto hide feature, my copyright looks to high.
What is the best way to have the Label appear at the bottom of the Form?
Thanks
0
Comment
Question by:GarySB
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:djon2003
ID: 37059936
Copyright_lbl.Top = Me.Height - Copyright_lbl.Height
0
 

Author Comment

by:GarySB
ID: 37059980
using Me.Height is displaying it about four inches from the bottom.  Way to high.  I switched Me to Screen and it was below visible, so i subtracted 1000 and now i can see it, but it still does not adjust for the windows bar if it is showing.
0
 
LVL 9

Expert Comment

by:djon2003
ID: 37060010
I looked at an old VB6 code. And I was using Form.ScaleHeight

You can try that, but not quite sure it would fix it.

Can you give me the whole form code ?
0
 

Author Comment

by:GarySB
ID: 37060086
What about this.  I saw another solution that said to use the picturebox and set the align to bottom.  If you can now just tell me how to center it at the bottom I'll accept, Thanks
0
 
LVL 9

Accepted Solution

by:
djon2003 earned 1000 total points
ID: 37060107
Well, you already have the centering formula. LEFT = (Container.Width - Control.Width) / 2

As :
Copyright_lbl.left = (Screen.Width - Copyright_lbl.Width) / 2


To be centered to the form, it shall be :
Copyright_lbl.left = (Me.Width - Copyright_lbl.Width) / 2
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

850 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