Listbox Header Background

Hey guys,

So I’ve successfully stolen the code I need to apply alternate shading/colour to my listbox rows, now I need code to apply a background colour to my listbox headings?

Possible?

Cheers, Ken.

sure … use my Listbox Header class… make the header look/feel/do what you want (for the most part)
www.rdS.com/lb_header.zip

Many thx mate. :wink:

Does this mean that there is no ‘standard’ way to affect listbox header backgrounds in the Xojo Listbox class?

[quote=344161:@Ken Boyle]Many thx mate. :wink:

Does this mean that there is no ‘standard’ way to affect listbox header backgrounds in the Xojo Listbox class?[/quote]

Yes, That’s correct Ken.

TestWindow->Open Event:

ok, sorry to be all noob about this, but just exactly how do I code for the header background? Is it here? How?
Or is it in the CellBackgroundPaint event? How?

TestLst.Heading(0) = “Session”
TestLst.Heading(1) = “Date”

TestLst.ColumnAlignment(0) = listbox.AlignCenter
TestLst.ColumnAlignment(1) = listbox.AlignCenter

// TestLst.SortedColumn = 1
// TestLst.ColumnSortDirection(1) = Listbox.SortAscending

You alter the class to fit your needs.
if it won’t or doesn’t fit your needs, then try something else.

Is it possible to put icons (i.e., small images) in column headers?

Alter the PAINT functions as required.
Tadpole has a super altered version that has Header Click with Direction Icons for sorting

The whole idea was to provide the infrastructure to expand as your requirments demanded

Thanks @Dave S - This is excellent!