OWL NExt - Knowledge Base

[ Home | Contents | Search | Next | Previous | Up ]

Listbox Sort: LB_SORT

Date: 12/1/99
Time: 10:44:38 PM

Question:

I want to put a listbox into my client window directly.
I make my new class derived from TListBox (Twindow*,int,int,int,int,int,TModule)
and set the Attr.Style as LBS_NOTIFY, Because I don't want the listbox is sort type ,
However, It always function sort, how can I do this?
I don't use it in Dialog,so I could not use TListBox(parent, Resource Id).

Answer:

assume you set the LBS_NOTIFY attribute in Attr.Style with an
OR operator (Attr.Style |= LBS_NOTIFY). Since the TListBox constructor
contains "Attr.Style |= LBS_NORMAL", and since LBS_NORMAL = LBS_SORT | other flags,
your listbox is automatically sorted. If you want to avoid this, you have to
remove the LBS_SORT attribute with Attr.Style &= ~LBS_SORT.

Last changed: July 14, 2001