Alignment of text in RichTextBox

  • Thread starter Thread starter gsb58
  • Start date Start date
G

gsb58

Hi!

I'm doing a notepad application for learning.

I have a problem finding anything on how to align text left, center and
right in the RichTextBox.

Couldn't find any clear answer in the group.

Anybody that have a correct way to do this?

Thanks

Me.Name
 
If you want to align the complete text right or left or center you need to
do this in code:

RichTextBox1.SelectAll()
RichTextBox1.SelectionAlignment = HorizontalAlignment.Right

Hth greetz Peter
 
I have a problem finding anything on how to align text left, center and
right in the RichTextBox.

Select the text by calling the richtextbox' overloaded 'Select' method and
set the 'SelectionAlignment' property accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top