Multiselect Listbox or Alternate Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Multiselect Listbox or Alternate Solution
I am trying to create a listbox control that allows the user to select multiple items. But it seems that this option is not supported by the listbox control. Is that correct?
I thought an alternative might be to create two listboxes and allow the user to move items from the first list to the second and thus create a sort of a custom list. But I'm having problems trying to figure out how to accomplish this. What I need to happen is that once an item is selected in the first list and a button is clicked the item is moved to the second list and removed from the first. I've attached a picture of how that looks.
Any ideas or alternate solutions are very appreciated.
Regards,
Ali
- Labels:
-
Other
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
__________________
� � � � Tom Gutman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you very much for your sample file. I had no idea other scriptable components could be included and used. Your example was great.
Tom,
As always your help is greatly appreciated. I think I have a lot to still learn about Mathcad and I can count on you and everyone else on this site to help me along the way.
Thank you both,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Richard!
I tried the multiselection listbox. In my worksheet it uses a vector of options that is not always the same lenght. I found a way to tefresh the listbox when I chage the vector, using fRefresh variable. I still get an error when the vector is shorter than the previous.
I solved it changing the following sub
Sub MSlistbox_Change
If InitFlag<>1 Then
For i = 0 to UBound(Output)
If MSlistbox.Selected(i) = True Then
Output(i) = 1
` Else
Output(i) = 0
End If
Next
MSlistboxEvent.Recalculate()
End If
End Sub
in
Sub MSlistbox_Change
If InitFlag<>1 Then
MSlistboxEvent.Recalculate()
End If
End Sub
now it works... but I still don't undertand how it can work since I think I removed the part giving out the selection result.
However, if you would like to check it and include it in your code, I think this can be useful in the future for the community.
Thanks, Loris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I posted a fixed version of the listbox here:
http://communities.ptc.com/message/165816#165816
I also added it to a new version of the "Extra Components" document. That should handle your variable length vectors OK.
