Jump to content

Set Tab Stops In A List Box, How To?

Recommended Posts

I want do resize the tab stops in a list box so that simulates multiple columns with different column sizes (that is, similar to the appearance of the ListView).

To accomplish this task, I sent the LBS_SETTABSTOPS message (0x192) to the ListBox control by using the GuiSendMsg, but nothing happend?

Can someone have a look at the code, and see what i'm doing wrong?



; ListBox with tabbed-columns
Global $LBS_USETABSTOPS = 0x80

; Windows message constant for setting the tab stops for a list box
Global $LBS_SETTABSTOPS = 0x192

GuiCreate("Multi-Col listbox")
$list_1 = GUISetControl("list", "List 1", 60, 80, 250, 90, $LBS_USETABSTOPS)

Dim $LBTab[4]

$LBTab[0] = 30
$LBTab[1] = 70
$LBTab[2] = 110
$LBTab[3] = 30

; Send an LB_SETTABSTOPS message to the ListBox control.
; Set tab stops, params are Hwnd of list box, number of tabs in array, tab settings array
GuiSendMsg($list_1, $LBS_SETTABSTOPS, 4, $LBTab[0])

_GuiLB_AddString($list_1, StringReplace("Char,Decimal,Hex,Description", ",", @TAB))
_GuiLB_AddString($list_1, StringReplace("a,97,61,Lowercase A", ",", @TAB))
_GuiLB_AddString($list_1, StringReplace("b,98,62,Lowercase B", ",", @TAB))
_GuiLB_AddString($list_1, StringReplace("c,99,63,Lowercase C", ",", @TAB))
_GuiLB_AddString($list_1, StringReplace("d,100,64,Lowercase D", ",", @TAB))
_GuiLB_AddString($list_1, StringReplace("e,101,65,Lowercase E", ",", @TAB))


Func _GuiLB_AddString($ref, $string)
 Return GuiSendMsg($ref, 0x0180, 0, $string)
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...