VERTICALLY Aligning Text in a Text Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Howarth
    New Member
    • Dec 2010
    • 22

    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".
    [imgnothumb]http://bytes.com/attachments/attachment/6097d1329340320/excel-middle-align.jpg[/imgnothumb]
    Attached Files
    Last edited by NeoPa; Feb 15 '12, 10:59 PM. Reason: Made pic viewable
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Code:
    Const conCENTER As Byte = 2
    
    Me![<Text Box Name].TextAlign = conCENTER

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32636

      #3
      Wouldn't that align it in the centre horizontally rather than vertically as requested ADezii?

      Comment

      • smartchap
        New Member
        • Dec 2007
        • 236

        #4
        Please see the following site
        ** Link removed **

        it may be of help to you

        I have modified the code for you as :

        Code:
        Private Sub Command2_Click()
          Label2.Caption = "This" & vbCrLf & "is a" & vbCrLf & "long" & vbCrLf & "label to" & vbCrLf & "see how it reacts to the centering"
          Label2.Left = Picture1.Width / 2 - (Label2.Width / 2)
        
        End Sub
        Last edited by NeoPa; Feb 16 '12, 05:16 PM. Reason: Link to competing site removed

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          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)

          Comment

          Working...