Luis Fernandez
Member
- Local time
- Today, 09:00
- Joined
- Sep 16, 2023
- Messages
- 35
I have a problem that, although I haven't thought about it much, I don't think I see an easy solution.
In a multiselect lisbox when I click with the mouse and select an items/row, afterupdate and click are activated, but when I use the down arrow and I only position myself (not selecting) the 2 events are also activated, and although it is correct because I am in another row and afterupdate was activated because there was an update of the listbox, there was no selection.
Additionally, try in the beforeupdate event to see if the items were selected or not to compare it later with the new value of selected, but in the beforeupdate the new value is already present (selected), making it impossible to compare it to see if it changed.
In summary: there is no afterupdate event for a selected items, but one for the listbox and it is updated with anything (change of focus, positioning in another row, selecting it or not
Is there a way to only do things when a row is selected (changes color) and not when I scroll through the list?
In a multiselect lisbox when I click with the mouse and select an items/row, afterupdate and click are activated, but when I use the down arrow and I only position myself (not selecting) the 2 events are also activated, and although it is correct because I am in another row and afterupdate was activated because there was an update of the listbox, there was no selection.
Additionally, try in the beforeupdate event to see if the items were selected or not to compare it later with the new value of selected, but in the beforeupdate the new value is already present (selected), making it impossible to compare it to see if it changed.
In summary: there is no afterupdate event for a selected items, but one for the listbox and it is updated with anything (change of focus, positioning in another row, selecting it or not
Is there a way to only do things when a row is selected (changes color) and not when I scroll through the list?