Set the Sort icon in the Header Column

The following code works fine (read below):

LB_Souche.ColumnSortDirection(Col_Sort) = ListBox.SortDescending LB_Souche.SortedColumn = Col_Sort LB_Souche.HeaderType(Col_Sort) = Listbox.HeaderTypes.Sortable LB_Souche.Sort

Col_Sort is the column number.

Line 1: The SortDescending is set correctly,
Line 2: The Column # to be sorted is set correctly,
Line 3: The Header Type is set to Sortable
Line 4: The Sort is done correctly,
but I cannot set the Sort Direction icon.

The problem is with the ^ (upside down icon) logo: it is not set.

In my application, I do not need (to store / restore) the NoSort nor the SortAscending values, the only “allowed” change is SortDescending.
At window close time, I actually store some data that are loaded back at window open time and that works fine excepted the small Direction icon.

Idea ?

PS: in a different project, I use HeaderType(-1) to hide the Sort small icon.

Try setting the HeaderType first. You may not be able to set the columnSortDIrection before you set the type.

Thank you Greg.

I moved the HeaderType to the top… i see the small icon now.

Use ColumnSortDirection to set the descending sort type and PressHeader to set the icon.


me.ColumnSortDirection(0) = -1 me.PressHeader(0)