I have a listbox in which I need to handle CellClick, Change, and ContextualMenu events and be able to process contextual Menu operations on SelCount = 0, SelCount = 1, and SelCount > 1.
If SelCount = 1 or SelCount = 0, then the Contextual Menu is handled properly. However, if the SelCount > 1, the selection is cleared and only the row under the mouse pointer is seen by the ConstructContextualMenu / ContextualMenuAction events.
I currently check for Contextual clicks in the CellClick event and Change event at the top of the event code by checking for IsContextualClick. In CellClick, I return False and in Change, I simply Return.
No matter what I do, the multiselection state is always being cleared.
In other projects where I do not need to handle Change, this works as expected, so I’m obviously missing something in how Change is retailed to the other two events.
As an aside, is there a good explanation for why Change is called if all the user has done is click a row?