![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello!
I'm still working on my selection form.. Which has got a listbox. When nothing is selected the selectedindex = -1. Now when i select something i can't deselect it anymore.. So I made up this deselect button with the following click-event: myListbox.selectedIndex = -1 But this produces an [runtime] error everytime. Does anybody have a suggestion? Ghislain |
|
||||
|
If You don't require multiple selections then a radio button should be best for you....Check this code:
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
Thanks for all the replies.
For the time being I will just refill my listbox. Which does the same trick as well. But it might become too slow when my list becomes longer and longer.. I hope in the future the functionality to deselect-all will be implemented.. Thanks! |
|
||||
|
Have you tryied to set the index to -1?
That is , at least i think it is, the start point of any un-selected index..
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
Ghislain started off setting the index to -1 but, as mentioned, that gives a runtime error. If you trap that error with an empty error handler you'll get the deselection without the error being reported.
Sub EventsList_LostFocus ErrorLabel(ErrHandler) EventsList.SelectedIndex = -1 return ErrHandler: End Sub If your deselection comes within other code you'll need to have a goto to just after the selectedindex = -1 code. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Listbox and enter key | tsteward | Questions & Help Needed | 2 | 10-14-2008 07:30 AM |
| Lookup Contacts using a listbox | thartung | Questions & Help Needed | 9 | 02-27-2008 10:16 AM |
| How to fix ListBox Items? | Stellaferox | Questions & Help Needed | 12 | 02-22-2008 10:50 AM |
| Listbox difficulties. | dan kabestan | Questions & Help Needed | 2 | 12-15-2007 07:24 PM |
| listbox = arraylist ? | sloopa | Questions & Help Needed | 1 | 05-07-2007 01:38 PM |