Link to home
Start Free TrialLog in
Avatar of Harold_Lominac
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.
Avatar of rkellow
rkellow
Flag of United States of America image

Hi Harold,

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
Avatar of Harold_Lominac
Harold_Lominac

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.
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.
That's fine... I didn't understand the original question.

--Rob
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial