Workaround: ListBox SelectedIndexChanging Winforms event
Posted on 2006-10-22
In .net it doesn't appear that Bill Gates provided the SelectedIndexChanging event for the ListBox, using Winforms.
This event would allow cancelling changing the SelectedIndex, depending on a cancel parameter.
It would be ideal to have this event. Know anyone who has built this component as freeware
or payware? I would pay $100 for a listbox with this feature, since this is requiring workarounds.
Protected Sub myListBox.SelectedIndexChanging(oldSelectIndex as Integer, proposedSelectIndex as Integer, e as SomeEventWithCancel)
' Some processing with oldSelectIndex
If not processingWentOK()
e.Cancel = True ' which causes the proposed change to not occur.