Results 1 to 4 of 4

Thread: ListBox NonSelectable & Selectable

  1. #1
    Member marcuslee's Avatar
    Join Date
    Sep 2008
    Location
    Kansas, USA
    Age
    42
    Posts
    222
    Rep Power
    38

    ListBox NonSelectable & Selectable

    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

  2. #2
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: ListBox NonSelectable & Selectable

    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.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: ListBox NonSelectable & Selectable

    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.

    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    Member marcuslee's Avatar
    Join Date
    Sep 2008
    Location
    Kansas, USA
    Age
    42
    Posts
    222
    Rep Power
    38

    Re: ListBox NonSelectable & Selectable

    Quote Originally Posted by Petr Schreiber
    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.

    Quote Originally Posted by Michael Clease
    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:

    [code=thinBasic]
    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
    [/code]

    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."

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •