|
-
Apr 16th, 2007, 06:45 PM
#1
Thread Starter
Addicted Member
[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.
-
Apr 16th, 2007, 07:59 PM
#2
Addicted Member
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!
-
Apr 16th, 2007, 08:18 PM
#3
Addicted Member
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!
-
Apr 16th, 2007, 08:31 PM
#4
Addicted Member
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!
-
Apr 16th, 2007, 09:42 PM
#5
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|