VB Label Placement Question

Posted on 2011-10-31
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?
Question by:GarySB
    LVL 9

    Expert Comment

    Copyright_lbl.Top = Me.Height - Copyright_lbl.Height

    Author Comment

    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.
    LVL 9

    Expert Comment

    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 ?

    Author Comment

    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
    LVL 9

    Accepted Solution

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    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…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 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

    14 Experts available now in Live!

    Get 1:1 Help Now