Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capturing listbox selections
Message
From
30/10/1997 07:43:54
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00057049
Message ID:
00057351
Views:
31
Hi Jim,

Yep, they're definitely deselected. This is odd. On leaving the list box they remain selected. And I would expect the selected items to change when using the mouse to set focus to the box based on a click, Ctrl+click, etc. But I would expect the selected items to remain selected when merely tabbing into the box. I will probably run some tests on a test form to verify the behavior. If this is the way it's suppoed to be, I can work with it, but it doesn't seem correct to me.

Bill

>Bill,
>
>I don't know if that is correct behavior or not. Have you checked by running through all the items and checking their selected status?
>
>>Hi Jim,
>>
>>DODEFAULT()/NODEFAULT did the trick. However, I am seeing one piece of behavior that I'm not sure is correct or not, at least as far as Windows behavior is concerned. After items are selected, if the user leaves the list box and then TABs into it, all items are deselected ( i.e. none selected ). Is this correct correct Windows behavior? I've not paid attention to this anywhere else.
>>
>>Thanks,
>>Bill
>>
>>>Bill,
>>>
>>>here's an idea for your keypress code, tyr this and see if it helps;
>>>
>>> * Listbox Keypress
>>> DoDefault()
>>> * Now do you processing of the entries
>>>
>>> NODEFAULT && after you process your entries to keep the default keypress behavior from firing twice
>>>
>>>
>>>
>>>
>>>>>>I have a multi-select listbox on a form. As items are selected, I have to update a textbox on the form with amounts from the selected items. No problem with single items selected or multiple items selected with the mouse ( I use the mouseup event to process so the item is already marked as selected ).
>>>>>>
>>>>>>However, when the keyboard is used to select items, I use the keypress event to process in. But the item(s) is not marked as selected until after the event. I got around this with single items by processing the opposite of whether the item is currently selected. This won't work when multiple items are selected ( Shift + Space ) because the "in-between" items are not yet selected and I have no way of telling all the items that will wind up being selected after the event is completed. Is there another event I can use to do my processing in which the listbox "sees" the items as already selected?
>>>>>>
>>>>>>Thanks,
>>>>>>Bill
>>>>>
>>>>>Did you try count selected in InteractiveChange?
>>>>
>>>>Hi Edward,
>>>>
>>>>I looked at Interactivechange, but it fires whenever the pointer is moved, not just when items are selected. Valid only fires when Enter is pressed, not when items selected using Space bar. Will have to give it some more thought.
>>>>
>>>>Thanks,
>>>>Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform