CompuServe Messages

Listbox BUG!!!

    07-Oct-91 15:47:41
Sb: Listbox BUG!!!
Fm: Selden McCabe 75300,2244
To: ALL
Here is what I consider a "bug" in Visual Basic. As long as you know about it, you can program around it easily enough. If you have a list box with an item selected, and you set the listindex property to -1 (to un-select the item), it generates a click event for that list box. This sure doesn't seem right to me, and it sorely confused the Microsoft VB help guy I reported it to. He went "hmmm" and promised to call me back. Sure enough he did a couple of hours later, and basically said "That's the way it's supposed to work." Well, this extra click event was causing me problems. But, once I understood what was going on, I merely put the following line of code in my click procedure for that list box if List1.listindex = -1 then exit sub and the problems went away. This doesn't seem right, but there it is! Hope this helps some of you out there working with mutiple list box forms! Selden