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 = "1234";
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 = "1234";
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…