In the ListBox control for Windows Forms, if I set ContextMenuStrip to display in the MouseDown event on the element, ContextMenuStrip will be shown, but the element that I click on the right button will not be selected. Elements can only be selected when I press the left button.
In the DataGrid view, I can fix this using the HitTest () method to check which item is in the current location, then select it and then display ContextMenuStrip. but unfortunately there is no HitTest method in the ListBox.
Is there any way?
user915331
source share