I have used some code in VB.net which detects when a mouse button is clicked (rather conveniently works with right click, left click and middle click not sure about the forward and back buttons, since my mouse doesn't have those), and it outputs what was clicked and which button was used. However, it only seems to detect a left click when clicking on an object (a list box I called lstDebug, which outputs the thing I clicked on and which button was used).
Public Sub ClickHandler(sender As Object, e As MouseEventArgs) Handles Me.MouseClick, lstDebug.MouseClick
lstDebug.Items.Add(sender.name)
lstDebug.Items.Add(e.Button.ToString)
It outputs fine (outputted text goes as follows:)
Form1
Right
lstDebug
Left
But gives no indication of a right click or middle click when the cursor is on the list box.
Is this a bug, something which is meant to be there for a reason and there's no way around it, or is there a code solution? Thanks. This is what the form/design looks like, the list box is in blue