none
RichTextBox Tab Stops

    Question

  • Hello,

     

    I am trying to set tab stops on WPF RichTextBox, with no luck. Windows Forms RichTextBox has a SelectionTab property, and RichEdit has the EM_SETTABSTOPS or EM_SETPARAFORMAT messages. What is the way of doing the same on WPF RichTextBox?

     

    Thank you.

    Monday, July 09, 2007 5:18 PM

Answers

  • Tab stops are not supported on FlowDocument, and therefore not on RichTextBox either.

     

    There is a TextIndent property on Paragraph, however, which controls how far to indent the first line of each paragraph-- essentially, an initial tab.  Depending on your needs, this might be sufficient.

    Monday, July 09, 2007 10:47 PM
  • Currently no support for this... We will consider this for future releases

    Thanks
    Monday, October 20, 2008 3:26 PM
    Moderator

All replies

  • Tab stops are not supported on FlowDocument, and therefore not on RichTextBox either.

     

    There is a TextIndent property on Paragraph, however, which controls how far to indent the first line of each paragraph-- essentially, an initial tab.  Depending on your needs, this might be sufficient.

    Monday, July 09, 2007 10:47 PM
  • Is there any lower API that might be useful for tab stops?

    Thursday, November 15, 2007 11:06 PM
  • Still no answer to this? It is also very important for me.
    Monday, October 20, 2008 3:21 PM
  • Currently no support for this... We will consider this for future releases

    Thanks
    Monday, October 20, 2008 3:26 PM
    Moderator
  • Its almost 2 years since this reply. Whats the current status?

    Wednesday, August 25, 2010 2:09 PM
  • Having same problem checked google, and stumbled upon this page. And few seconds ago checked Windows7 SDK and RichEdit.h file, apparently there is no EM_SETTABSTOPS message there, only support for tab size is paragraph message EM_SETPARAFORMAT. I guess no way to set default size for all tabs at once, you must use select all text and change paragraph tabs formating to accomplish this task. textbox.SelectAll(); textbox.SelectionTabs = tabWidths; textbox.Select(0, 0); TIP: to avoid flickering create Redraw property and subclass WM_PAINT for RichTextBox control, allowing default paint only when Redraw flag set.
    Tuesday, September 07, 2010 5:25 AM