Is new event possible for listbox?

Started by funkitect, March 12, 2014, 09:58:06 AM

Previous topic - Next topic

funkitect

Hi all,

The OnSelChanged event for listbox is not adequate for my needs and I was wondering if there is a way around it of if a new event is possible?

For a listbox control the OnSelChanged event fires each time the mouse selects an item.  If you set the list style to "multiple" it still fires each time the mouse selects an item...not just once after the selection process is completed by letting go of "shift" or "ctrl".  Would it be possible to add some kind of "OnSelectionCompleted" event? 

As a workaround I was thinking maybe during the OnSelChanged event I could try to detect of the CTRL or SHIFT key is held down...but I think that would always be detected as true and never false so there would still never be a way to know if the selection was completed.  Maybe there is some other workaround that I haven't thought of...

The reason I want this is because I have to give the user some feedback after some selections are made but I don't want to interrupt the selection process with a (possibly false!) warning message until the selections are final.

My solution now is to provide the feedback when the user presses OK and the message has to explain the problem and where to go to fix it.  It would be much better if the feedback were more immediate and self-explanatory.

Thanks,

James LeVieux

owenwengerd

I think this is asking for trouble, but I'm curious to know more about the nature of your listbox and the feedback you want to provide.

roy_043

If a user selects multiple items with single picks detecting when the selection is final would be very hard if not impossible without explicit confirmation from the user (OK button).

funkitect

Now that I think about it releasing the CTRL or SHIFT key does not necessarily mean the user has finished selecting. A user could release one of those keys and the press it again and continue selecting.  I'll just have to figure out some other non-intrusive way to alert the user.

Thanks,

James

Fred Tomke

Hi, funkitect, you are right, you can add selection by pressing shift, and modifiing the selection by pressing ctrl. Thats why OpenDCL cannot know, when the user is ready selecting items. Either you continue validating the selection by OK button (or any other button beside the list box to validate before pressing OK) or you just extent your dialog with a readonly editbox as status bar to alert the user why the current selection is not applicable (or anything else).

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]