Listbox Columns >_<
#1
Posted 09 December 2004 - 04:16 PM
#2
Posted 09 December 2004 - 05:25 PM
You could add tabstops to the control via 0x80, which is LBS_USETABSTOPS:Is there any way to have different "fields" in a listbox? I.e., having both columns and rows instead of just rows?
gui, add, ListBox, 0x80 vMyListBox, Item1|Item2|Item3
If you have a need for custom tabstops, I can add that quickly since it's basically the same thing as tabstops in edit controls, which were just added to v1.0.24.
#3
Posted 09 December 2004 - 06:47 PM
gui, add, ListBox, vMyListBox, Item1|Item2|Item3 gui, add, ListBox, 0x80 vMyListBox2, Item1|Item2|Item3 gui, showChris I'm not sure I notice the differences between these two listboxes.
Jonny are you looking for something like this?

I would be interested in being able to do something like this. For now I have just added whitespace between text to make my own columns. If something like the above can be added the ability to center/left/right justify the text in the columns would be nice. The headers might not be an option, but can be just a text control or buttons above the listbox.
thanks,
beardboy
#4
Posted 09 December 2004 - 07:50 PM
#5
Posted 09 December 2004 - 11:04 PM
The difference is that tabs inside each item work like real tabs. The example I gave didn't properly show that. It should have been:Chris I'm not sure I notice the differences between these two listboxes.
Gui, add, ListBox, 0x80 vMyListBox2, Row1Col1`tR1C2|Item2|Item3
You can also use literal tab characters in the script in place of `t.
If custom tabstops were added, you could do this:
Gui, add, ListBox, 0x80 vMyListBox2 t32 t80 t150, ...
I think that's a SysListView32, which is on the to-do list.Yes, beardboy's screenshot looks almost exactly like what I want.
#6
Posted 10 December 2004 - 12:11 AM
I think that's a SysListView32, which is on the to-do list.Yes, beardboy's screenshot looks almost exactly like what I want.
It looks like a grid component that I've used with Borland's CBuilder.
#7
Posted 13 December 2004 - 11:56 AM
by the way, when I update the listbox using GuiControl,
instead of a tab I get a square box (I use `t). However, this is not the case when I run your example (Gui, add, ListBox, 0x80 vMyListBox2, Row1Col1`tR1C2|Item2|Item3) which defines the listbox contents when creating the control
Is this is a bug or is there something I need to do different?
Thanks
The difference is that tabs inside each item work like real tabs. The example I gave didn't properly show that. It should have been:Chris I'm not sure I notice the differences between these two listboxes.
Gui, add, ListBox, 0x80 vMyListBox2, Row1Col1`tR1C2|Item2|Item3
You can also use literal tab characters in the script in place of `t.
If custom tabstops were added, you could do this:
Gui, add, ListBox, 0x80 vMyListBox2 t32 t80 t150, ...I think that's a SysListView32, which is on the to-do list.Yes, beardboy's screenshot looks almost exactly like what I want.
#8
Posted 13 December 2004 - 01:20 PM
Thanks.I second the request on SysListView32
You need the 0x80 in the control's options when it is created, otherwise tabs are never expanded into true tab characters when more items are added to its list later.by the way, when I update the listbox using GuiControl,
instead of a tab I get a square box (I use `t). However, this is not the case when I run your example (Gui, add, ListBox, 0x80 vMyListBox2, Row1Col1`tR1C2|Item2|Item3) which defines the listbox contents when creating the control
Edit: In the latest version, ListBoxes can be given custom tabstops. I guess it could even be used as a poor man's SysListView32.
#9
Posted 19 December 2006 - 04:32 PM
Anybody know - can we deal columns in listbox in last versions?
#10
Posted 19 December 2006 - 04:53 PM
#11
Posted 19 December 2006 - 06:54 PM
Please, if you have some examples, show theirs here.
#12
Posted 19 December 2006 - 07:03 PM
; Create the ListView with two columns, Name and Size:
Gui, Add, ListView, r20 w700 gMyListView, Name|Size (KB)
; Gather a list of file names from a folder and put them into the ListView:
Loop, %A_MyDocuments%\*.*
LV_Add("", A_LoopFileName, A_LoopFileSizeKB)
LV_ModifyCol() ; Auto-size each column to fit its contents.
LV_ModifyCol(2, "Integer") ; For sorting purposes, indicate that column 2 is an integer.
; Display the window and return. The script will be notified whenever the user double clicks a row.
Gui, Show
return
MyListView:
if A_GuiEvent = DoubleClick
{
LV_GetText(RowText, A_EventInfo) ; Get the text from the row's first field.
ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%"
}
return
GuiClose: ; Indicate that the script should exit automatically when the window is closed.
ExitApp
#13
Posted 19 December 2006 - 07:37 PM




