Results 1 to 5 of 5

Thread: [Resolved] Listbox

  1. #1

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Resolved [Resolved] Listbox

    I have a listbox which has MultiSelect mode on and ListStyleOption on.
    How can I make that all the little squares appear selected?
    I'd like to use two buttons: Select all and Select none.
    Last edited by Fonty; Apr 17th, 2007 at 08:35 AM.

  2. #2
    Addicted Member kewakl's Avatar
    Join Date
    Oct 2006
    Location
    between keyboard and chair
    Posts
    220

    Re: Listbox

    removed by poster - failed to get working
    Last edited by kewakl; Apr 16th, 2007 at 09:25 PM.
    Do not use if shrinkwrap is broken or missing!
    I'm learning how to fish, too!

  3. #3
    Addicted Member kewakl's Avatar
    Join Date
    Oct 2006
    Location
    between keyboard and chair
    Posts
    220

    Re: Listbox

    removed by poster - failed to get working
    Last edited by kewakl; Apr 16th, 2007 at 09:24 PM.
    Do not use if shrinkwrap is broken or missing!
    I'm learning how to fish, too!

  4. #4
    Addicted Member kewakl's Avatar
    Join Date
    Oct 2006
    Location
    between keyboard and chair
    Posts
    220

    Re: Listbox

    removed by poster - failed to get working

    @Moderator: can you remove these empty posts? Thank you
    Last edited by kewakl; Apr 16th, 2007 at 09:47 PM.
    Do not use if shrinkwrap is broken or missing!
    I'm learning how to fish, too!

  5. #5
    Addicted Member kewakl's Avatar
    Join Date
    Oct 2006
    Location
    between keyboard and chair
    Posts
    220

    Re: Listbox

    I tried using API, cannot get .hwnd of listbox, so...


    you *could* loop through the listbox, setting/unsetting the checks!

    XL2k7 - the listbox must be an ActiveX listbox and not a form control listbox
    XL2k3 - I'll have to check tomorrow! (by memory , it should be ok) It works XL2k3



    Private Sub cmdSelectAll_Click()
    'this will select all
    Dim nLoopIndex As Integer
    For nLoopIndex = 0 To ListBox1.ListCount - 1
    ListBox1.Selected(nLoopIndex) = True
    Next
    End Sub

    Private Sub cmdDeselectAll_Click()
    'this will deselect all
    Dim nLoopIndex As Integer
    For nLoopIndex = 0 To ListBox1.ListCount - 1
    ListBox1.Selected(nLoopIndex) = False
    Next
    End Sub
    Last edited by kewakl; Apr 17th, 2007 at 07:38 AM. Reason: grammar
    Do not use if shrinkwrap is broken or missing!
    I'm learning how to fish, too!

Posting Permissions

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



Click Here to Expand Forum to Full Width