On Oct 17, 2006, at 11:45 PM, Steve Roy wrote:

I have been struggling with this for a while. When my window opens, the listbox is empty of content yet, but I still want it to show which column is sorted and what the sort order is. On Mac OS X this is denoted by the column heading being blue. I seem to remember that with RB 5.5 I was able to make my listbox header look sorted by calling PressHeader but for some reason I'm unable to make this work now with 2006r4.

The official method is to do this:

MyListbox.ColumnSortDirection(0) = Listbox.SortAscending
MyListbox.SortedColumn = 0
MyListbox.Sort()

But I have this code in the Open event of my window and the window still comes up with the listbox without sorted header.

Any other idea everyone?

I should mention that I searched the archives and that there are many results, but none that is a decisive answer. Mostly the usual answer is to do the above, but that doesn't solve the header look problem.


You need to set the HeadingIndex property. Setting it appears to have the same effect as clicking the header, including called the HeaderPressed event handler. Note that the documentation describes this property as "obsolete", so you might consider making a feature request for the behavior you need.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to