Nathan Campos
Nathan Campos

Reputation: 29497

RichTextBox Text Positioning

I'm building a simple application, but I need to know how to use a RichTextBox and position the text on it, like: center, right and left. But how I can do this?

Upvotes: 0

Views: 4359

Answers (2)

Fred
Fred

Reputation: 1

Try the property of selectionChanged and set the Horizantal alignment to either center, right, or left.

private void richTxtBox_SelectionChanged(object sender, EventArgs e) {
      richTxtBox.SelectionAlignment = HorizontalAlignment.Center;
    }

Upvotes: 0

David Johnstone
David Johnstone

Reputation: 24450

Use the SelectionAlignment property. See MSDN for details.

Upvotes: 3

Related Questions