JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Aligning Text in a Rich Text Box

You can set the alignment of text in a rich text box paragraph by paragraph using the SelectionAlignment property. You just select the paragraph you want to align—or place the insertion point in that paragraph—and set the SelectionAlignment property to one of the following values:

  • HorizontalAlignment.Left— 0 (the default)—The paragraph is aligned along the left margin.

  • HorizontalAlignment.Right— 1—The paragraph is aligned along the right margin.

  • HorizontalAlignment.Center— 2—The paragraph is centered between the left and right margins.

Being able to align text paragraph by paragraph like this is much more powerful than the simple TextAlign property of standard text box, which aligns all the text at the same time.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor