Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 55691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:25:01+00:00 2026-05-10T17:25:01+00:00

Is there any way to change the default tab size in a .NET RichTextBox?

  • 0

Is there any way to change the default tab size in a .NET RichTextBox? It currently seems to be set to the equivalent of 8 spaces which is kinda large for my taste.

Edit: To clarify, I want to set the global default of ‘\t’ displays as 4 spaces for the control. From what I can understand, the SelectionTabs property requires you to select all the text first and then the the tab widths via the array. I will do this if I have to, but I would rather just change the global default once, if possible, sot that I don’t have to do that every time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:25:02+00:00Added an answer on May 10, 2026 at 5:25 pm

    You can set it by setting the SelectionTabs property.

    private void Form1_Load(object sender, EventArgs e) {     richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 }; } 

    UPDATE:
    The sequence matters….

    If you set the tabs prior to the control’s text being initialized, then you don’t have to select the text prior to setting the tabs.

    For example, in the above code, this will keep the text with the original 8 spaces tab stops:

    richTextBox1.Text = '\t1\t2\t3\t4'; richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 }; 

    But this will use the new ones:

    richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 }; richTextBox1.Text = '\t1\t2\t3\t4'; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to change default font of controls in winforms. I must
By any chance, is there any easy way to set a default MasterView for
Is there any way to change the default application? E.g. change mailto: behavior to
I wonder if there is any way I could change the default output (System.out)
Is there any way to change the default font (Portable User Interface) used by
Is there a way to change the default font size in the Swing GTK
Quick question... Is there any way to change the default behavior of a scrollbar
Is there any way to change the default vnc server port on a Mac.
Is there any way to change the selection bar text color in a list
Is there any way to change(increase) the data type of a column while saving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.