Harold_Lominac
asked on
How do I set Tab Stops in VB.Net Rich Text Boxes?
I am programming in Visual Basic .NET and I wish to set tab stops in various text boxes. The SendMessages and LB_SETTABSTOPS does not work for BV.NET like it does in VB6.
ASKER
Thanks for replying Rob. Perhaps I used the wrong terminology. When I am in a rich text box, for example, and I press the Tab key, the cursor moves to the nearest tab stop within the text box. It is similar to Microsoft Word. I wish to set the positions in the document so I can have fields line up. IN VB6 I can use LB_SETTABSTOPS and SendMessage to do this, but this doesn’t work in VB.NET.
ASKER
Well I think I found the answer myself.
The tabs are set for highlighted text only.
Use the SelectionTabs member as:
Dim ListBoxTabs() As Integer = {100, 300}
RTB.SelectionTabs = ListBoxTabs
This portion is executed when a button is pressed.
The tab stops are applied to the highlighted text.
The tabs are set for highlighted text only.
Use the SelectionTabs member as:
Dim ListBoxTabs() As Integer = {100, 300}
RTB.SelectionTabs = ListBoxTabs
This portion is executed when a button is pressed.
The tab stops are applied to the highlighted text.
That's fine... I didn't understand the original question.
--Rob
--Rob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First, make sure that the TabStop property for each of the controls you want to have a tabstop is set to True. Then set the TabIndex value for each control to the order you want the tabstops to be in (first control TabIndex = 1, second control TabIndex = 2, etc.).
I hope that helps.
--Rob