By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,469 Members | 982 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,469 IT Pros & Developers. It's quick & easy.

Justification for a label in code

P: 1
Quick question, I have a label that is counting the letters that are typed in a textbox. But what I do want with that label is that I need it to be right justified. If I set the properties of the label to have right align it doesn't seem to work. So do I need to align it in the code so when it hits double digits it doesn't run over the item to the right but just expands to the left... How can I justify the label via code?

Here's the code I'm using for the label...

Expand|Select|Wrap|Line Numbers
  1. Dim a As Object
  2. a = Len(Me.tbImperial.Text)
  3. lblImperialCount.Text = (1 + a)
Adding "lblImperialCount.TextAlign = ContentAlignment.MiddleRight" to it doesn't seem to make a difference either...

I hope I am clear enough with my questions :)

3 Weeks Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.