Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to catch Scrolling in ListBox
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00345588
Message ID:
00345846
Views:
18
David,
>
>>Thanks for the reply. I tried to SetFocus to some form's control and then back to this in ListBox.MouseUp event. It partially helps, however, sometimes whole content of listbox disappears and listbox becames blank :( I'm afraid, there is nothing I can do with this listbox bug. How pity :(((( It seems to me, that I need to design another control, based on grid. This grid should behave similar to multi-select listbox. This is very tough problem, I'm afraid, but it seems to me, that I must create this control because of VFP multi-listbox bug...
>
>I'm not sure what kind of "bug" you think you are having. Moving focus out

I described this bug in other threads (see 'Flakiness behavior of listbox'). The problem is if multi-select listbox contains more than 100 items, when a user tries to scroll listbox, using mouse and scrollbar (clicking on bottom button with dnarrow), the listbox becomes a mess (I mean, one item covers another, etc.) You may try to reproduce this behavior. My colleague, who started this application, designed great class with several nice features: it has exclude checkbox and clear button. Clear button clears all selections and if I check exclude, all selections became red. This functionality remains in disable mode also, but in this case selections are in light blue/light red (rose). This control also has save/restore feature, e.g. it remembers the previous selections and restores them, when I start my form. It has some other cool features. However, this control doesn't work, as I said, if number of items are greater than 100. This bug really strikes me. Especially because application is completed and works. And I understand, that designing a similar behavior in grid would be a real PITA, if it's doable at all.

I also noticed, that if I click on button of the form, forcing moving focus, listbox refreshes and becomes 'normal' again. So, I thought about workaround switching focus programatically in MouseUp event. It apparently helps, but not at all. So, it seems to me, that I have no choice :(


from under a control during an event like MouseUp can definately be problematic. Perhaps if you describe what you are trying to accomplish we can come up with a workable solution. What kind of a UI need requires you to know if the user has scrolled to another section of the listbox, but does not change their selected item?
>
>>BTW, if my control consists of several controls, how can I add properties/methods to the inner control? For example, this control I was working, consists of container _-> listbox, commandbutton, checkbox. I wanted to add listbox TopIndex_assign, but can not do it in Class menu. Is there a way to do this?
>
>You can't. The Class designer will only add properties and methods to the outermost container. The same for the Form designer, it will only add to the form. You'll have to but the code in a subclass of the listbox, and put an instance of that subclass in the container.

Ok. I expected this. I thought about workaround in TopIndex_assign (that's why I wanted to change properties of inner control), but I doubt, that this can help.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform