Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleSet tabs in a RichTextBox in Visual Basic .NET
DescriptionThis example shows how to set tabs in a RichTextBox in Visual Basic .NET.
KeywordsRichTextBox, tabs, VB.NET
CategoriesVB.NET, Controls
 
The RichTextBox control can set different tabs for different parts of its text so this example makes some text, selects it, and then sets its tabs.

In the following code, the program uses the control's SelectAll method to select all of the text. It sets the SelectionTabs property to an array of Integers giving the tab positions. It sets AcceptsTab to True to ensure that tab characters go into the control rather than tabbing off to the next control and then it moves the selection position to the beginning of the text.

 
rchDocument.SelectAll()
rchDocument.SelectionTabs = New Integer() {20, 40, 80, 120}
rchDocument.AcceptsTab = True
rchDocument.Select(0, 0)
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated