When I first press the control key (left) and then press the left mouse button why the following code is executed. I am modifying existing code and the code below already exists. I assume that no one has tried this before by pressing the control key, it was used only with a left click and always worked for this case. But I want another code to be executed when the mouse button is pressed, pressed at the same time as pressing the control key.
private void treeList1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { TreeList tree = sender as TreeList; if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && tree.State == TreeListState.Regular) {
I would really appreciate any hint or help.
PS I would like to add that in the above case, when I check the value of e.button, it shows that it is equal to Right, although I pressed the left mouse button and the Ctrl key. This is a mystery to me.
Dear StackOverflow fellows: I found a problem, since I use VM on MAC, I had to disable some key mappings in the settings of my virtual machine, and now my source code is working. Thank you for your help.
source share