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

VERTICALLY Aligning Text in a Text Box

P: 22
I have a rather large text box in a report. Sometimes the Control Source is one sentence. Sometimes the Control Source is a paragraph.

I want to keep "Can Grow" and "Can Shrink" both set to "No".

Given this, is there a way to VERTICALLY align the text in the text box? Excel calls this "Middle Align".

Attached Images
File Type: jpg Excel Middle Align.JPG (22.8 KB, 4321 views)
Feb 15 '12 #1
Share this Question
Share on Google+
4 Replies


ADezii
Expert 5K+
P: 8,597
Expand|Select|Wrap|Line Numbers
  1. Const conCENTER As Byte = 2
  2.  
  3. Me![<Text Box Name].TextAlign = conCENTER
Feb 15 '12 #2

NeoPa
Expert Mod 15k+
P: 31,186
Wouldn't that align it in the centre horizontally rather than vertically as requested ADezii?
Feb 15 '12 #3

smartchap
100+
P: 236
Please see the following site
** Link removed **

it may be of help to you

I have modified the code for you as :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command2_Click()
  2.   Label2.Caption = "This" & vbCrLf & "is a" & vbCrLf & "long" & vbCrLf & "label to" & vbCrLf & "see how it reacts to the centering"
  3.   Label2.Left = Picture1.Width / 2 - (Label2.Width / 2)
  4.  
  5. End Sub
Feb 16 '12 #4

ADezii
Expert 5K+
P: 8,597
Wouldn't that align it in the centre horizontally rather than vertically as requested ADezii?
Oops, sorry about that, I guess I was 'misaligned'! (LOL)
Feb 16 '12 #5

Post your reply

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