469,275 Members | 1,619 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

VERTICALLY Aligning Text in a Text Box

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, 6463 views)
Feb 15 '12 #1
4 9184
ADezii
8,800 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. Const conCENTER As Byte = 2
  2.  
  3. Me![<Text Box Name].TextAlign = conCENTER
Feb 15 '12 #2
NeoPa
32,172 Expert Mod 16PB
Wouldn't that align it in the centre horizontally rather than vertically as requested ADezii?
Feb 15 '12 #3
smartchap
236 100+
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
8,800 Expert 8TB
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.

Similar topics

6 posts views Thread by Edo van der Zouwen | last post: by
2 posts views Thread by Iain Hallam | last post: by
1 post views Thread by Suresh Tri | last post: by
4 posts views Thread by David Garamond | last post: by
4 posts views Thread by Greg Scharlemann | last post: by
2 posts views Thread by Casimir | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.