![]() ![]() ![]() LNumCols = UBound(alColWidths) - LBound(alColWidths) + 1Ĭall SendMessage(lbListbox.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)Ĭall SendMessage(lbListbox.hwnd, LB_SETTABSTOPS, lNumCols, alColWidths(0))ĭebug.Print "Error in ListboxSetTabStops: " & Err. Public Function ListboxSetTabStops(lbListbox As ListBox, alColWidths() As Long, Optional lNumCols As Long = -1) As BooleanĬonst LB_SETTABSTOPS = &H192, WM_PAINT = &HF ' ListboxSetTabStops Me.List1, alColWidths ' lSumColWidths = lSumColWidths + alColWidths(lThisCol) ' alColWidths(lThisCol) = lSumColWidths + clM圜olTabWidth 'Tab stops are cummulative ![]() ' For lThisCol = 1 To UBound(alColWidths) private sub btnguinessclick (sender as object, e as eventargs) handles btnguiness.click dim lines system.io.file.readalllines ('database.txt') dim parts lines (1). ' Dim lThisCol As Long, lSumColWidths As Long ' Example: For a listbox with three columns use equally spaced at 30 chars Open the newly copied HTML file in an editor, like Notepad. Me.List1.AddItem "Column1" & vbTab & "Column2" In the Dialogs Page select the HtmlHost control by using the combobox from the Properties. 'Notes : When adding data to the listbox you must delimit your columns with 'Outputs : Returns True on success, else returns False. ' additional columns may be painted over. ' If this is less than the number of columns visible, the ' The number of columns to alter the tab positions of. ' alColWidths A zero based one dimension array of longs containing 'Inputs : lbListbox The listbox to set the tab positions 'Purpose : Sets the tab positions in a listbox Private Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long To set the tab positions of a listbox use the following code: ![]()
0 Comments
Leave a Reply. |