How I can set solid tab with Printer object? Or How I can set solid tabs in Listbox Control, chr(9) is not very useful to my project.
Printable View
How I can set solid tab with Printer object? Or How I can set solid tabs in Listbox Control, chr(9) is not very useful to my project.
Code:'set tab stops in a listbox
'appears as columns
'
Option Explicit
'
Public Declare Function SendMessageArray Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Const LB_SETTABSTOPS = &H192
'<<<<< code for form >>>>>
'
Private Sub Command1_Click()
List1.AddItem "Nothing More"
List1.AddItem "Nothing Less"
List1.AddItem "Just A Sample"
Dim r As Long
'set up the tabstops in the listboxes
ReDim TabStop(1 To 3) As Long
'assign values to the tabs for the second third and fourth
'column (the first is flush against the listbox edge ie...0)
TabStop(1) = 80
TabStop(2) = 160
TabStop(3) = 240
'set the tabs
r = SendMessageArray(List1.hwnd, LB_SETTABSTOPS, 3, TabStop(1))
List1.Refresh
List1.AddItem "...A lesson" & vbTab & "in creating" & vbTab & "columns" & vbTab & "in a listbox!"
End Sub