| To set TAB stops in a ListBox you must create an array of type Long. The array's upper bound dictates the number of tab stops. Tab stops are defined in terms of "dialog units". While the GetDialogBaseUnits function combined with a simple calculation can be used to convert between dialog units and pixels, the easiest way to set tab stops where you want is by trial and error. The SendMessageArray is just a type safe version of the SendMessage API function. See the source code for details. Dim aTabs(3) As Long aTabs(0) = 75 aTabs(1) = 150 aTabs(2) = 225 'Clear any existing tabs. Call SendMessageArray(lstTabs.hwnd, LB_SETTABSTOPS, 0&, 0&) 'Set the tabs. Call SendMessageArray(lstTabs.hwnd, LB_SETTABSTOPS, 3&, aTabs(0)) To Right Align a column, such as a column of numbers, set tab stops as described but make the tab stop a negative number. In the above example, the right justify the first column, set aTabs(0) to -75. |
Set Tab-stops |
Express News India | Freelance ecommerce web development India