How to Right Justify/Center Text in Single-Line Text ControlLast reviewed: July 19, 1996Article ID: Q111952 |
The information in this article applies to:
SUMMARYTo center or right justify (align) the text in a text control that contains a single line of text, set the multiline property to True and the Alignment property to the desired value. Then trap the KeyPress event and use the multiline and MaxLength properties to trap the carriage return and convert it to another character.
MORE INFORMATION
Step-by-Step Example to Demonstrate a Right-Justified Text Control
Sub Form_Load() Dim boxht as Double boxht = Text1.Height Text1.Height = Text1.Height * 2 'This is to make sure the text will appear in the box Text1.Height = boxht End Sub Type text into the text control, and press the ENTER key. The keystroke is trapped, and the text does not change.
|
Additional reference words: 3.00 align format
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |