PDA

View Full Version : ListBox NonSelectable & Selectable



marcuslee
10-12-2009, 03:34
Is it possible to make some items in a listbox nonselectable? Almost like a Subheading (Subtitle), allowing the user to select entries under the nonselectable item.

The LBS_NOSEL equate makes the entire listbox nonselectable. I would like to make certain items this way but not the others.

Mark :?:

Michael Clease
10-12-2009, 11:11
I would suspect you would have to trap the messages to the control and then handle them as required.

See Mlgrid control for another option.

Petr Schreiber
10-12-2009, 11:23
Mark,

another option could be treeview, if you need some kind of structuration for your BFR project -> some nodes "chapters", and their subnodes the verses.

marcuslee
11-12-2009, 02:39
another option could be treeview, if you need some kind of structuration for your BFR project -> some nodes "chapters", and their subnodes the verses.


Treeview turned out to be a very nice option. Thank you for suggesting it.



I would suspect you would have to trap the messages to the control and then handle them as required.


Thank you for suggesting this. It led me to come up with the following:



SELECT CASE nmTV.hdr.Code
CASE %TVN_SELCHANGED
hTreeItem = TreeView_GetSelect(CBHNDL, %ID_MenuTREE)
Select Case hTreeItem
Case hRoot
'This next line clears the selection on the tree view.
TreeView_Select CBHNDL, %ID_MenuTREE, 0
End Select


I suppose this could be done with ListBox, though I didn't try. I liked the idea of using TreeView instead.

I say thanks to both of you.


Mark

EDIT: By the way, Petr, I like your word "structuration." :drink: