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 TextBox
KeywordsTextBox, tabs, set
CategoriesControls
 
Use the SendMessage API function to send the TextBox a EM_SETTABSTOPS message.
 
Private Sub Form_Load()
Dim tabs(1 To 2) As Long
Dim txt As String

    tabs(1) = 20
    tabs(2) = 130

    ' Set the tabs.
    SendMessage Text1.hwnd, EM_SETTABSTOPS, 2, tabs(1)

    ' Enter some values.
    txt = "Bacon Burger" & vbTab & "3.00" & vbCrLf
    txt = txt & vbTab & "Tomato" & vbTab & "0.15" & vbCrLf
    txt = txt & vbTab & "Extra Cheese" & vbTab & "0.20" & _
        vbCrLf
    txt = txt & "Large Fries" & vbTab & "0.99" & vbCrLf
    txt = txt & "Medium Softdrink" & vbTab & "1.05" & vbCrLf
    txt = txt & "" & vbCrLf
    txt = txt & "Subtotal" & vbTab & "5.39" & vbCrLf
    txt = txt & "Tax" & vbTab & vbTab & "0.38" & vbCrLf
    txt = txt & "Total" & vbTab & vbTab & "5.77" & vbCrLf
    Text1.Text = txt
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated