Sign in to follow this  
Followers 0
spytek_98

Set Tab Stops In A List Box, How To?

1 post in this topic

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?

Thanks

Spy

; 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))

GuiShow()
GuiWaitClose()

Func _GuiLB_AddString($ref, $string)
 Return GuiSendMsg($ref, 0x0180, 0, $string)
EndFunc

Share this post


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
Sign in to follow this  
Followers 0