Unable to detect right mouseclick in ComboBox

c#, combobox, right-click, winforms

Solution

I'm afraid that will not be posible unless you do some serious hacking. This article will explain.

Quoted for you:

Individual Controls

The following controls do not conform to the standard mouse click event behavior:

Button, CheckBox, ComboBox, and RadioButton controls

Left click: Click, MouseClick

Right click: No click events raised

Left double-click: Click, MouseClick; Click, MouseClick

Right double-click: No click events raised

Problem

I have a ComboBox that is a simple drop down style. I wanted to open a new window when the user right clicks on an item in the list, but am having trouble getting it to detect a right click has occurred. My code: ``` private void cmbCardList_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && cmbCardList.SelectedIndex != -1) { frmViewCard vc = new frmViewCard(); vc.updateCardDisplay(cmbCardList.SelectedItem); vc.Show(); } } ``` If I change e.Button == MouseButtons.Left the whole thing fires off just fine. Any way I can get this working as I intend?

Original source