By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,192 Members | 1,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,192 IT Pros & Developers. It's quick & easy.

ComboBox MouseDoubleClick Event Never Fires

P: n/a
Hello All,

For some reason, the MouseDoubleClick event for my ComboBox does not
appear to be working. I am not subscribed to any other events for this
control. I pulled out Spy++ and noticed that the WM_LBUTTONDBCLICK
message is indeed occurring. The ComboBox does not provide a
DoubleClick event like other controls do.

The Windows application is being developed in VS 2005.

Any ideas?

Thank you in advance,

--
Sean
Sep 15 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"The ComboBox does not provide a DoubleClick event like other controls do."
.......and therein lies the answer.

every time you left click the WM_LBUTTONDBCLICK will fire, doesn't mean your
combo is listening to it. You have to assign that event to the combo. In
visual studio this is really easy, in the designer click the combo, in the
properties windo on the right click the lightening symbol and scroll down to
the left click or whatever event it is (cant remember exact name of my head)
and double click in there. it hooks the event and creates the method for
you. Put your code in that method .

"senfo" <en**********@yahoo.comI-WANT-NO-SPAMwrote in message
news:eV**************@TK2MSFTNGP06.phx.gbl...
Hello All,

For some reason, the MouseDoubleClick event for my ComboBox does not
appear to be working. I am not subscribed to any other events for this
control. I pulled out Spy++ and noticed that the WM_LBUTTONDBCLICK
message is indeed occurring. The ComboBox does not provide a DoubleClick
event like other controls do.

The Windows application is being developed in VS 2005.

Any ideas?

Thank you in advance,

--
Sean

Sep 15 '06 #2

P: n/a
Daniel wrote:
"The ComboBox does not provide a DoubleClick event like other controls do."
......and therein lies the answer.

every time you left click the WM_LBUTTONDBCLICK will fire, doesn't mean your
combo is listening to it. You have to assign that event to the combo. In
visual studio this is really easy, in the designer click the combo, in the
properties windo on the right click the lightening symbol and scroll down to
the left click or whatever event it is (cant remember exact name of my head)
and double click in there. it hooks the event and creates the method for
you. Put your code in that method .
Hi Daniel,

Thank you for your reply. The problem isn't with subscribing to the
event, the problem is that the event is never raised. Some controls
provide the "Action" events Click, DoubleClick, MouseClick, and
MouseDoubleClick. The MouseClick events are similar to the Click
events; however, the MouseEvent events have an extended EventArgs class
for providing more detail about the click. The ComboBox control does
not provide the DoubleClick event; however, the other three (Click,
MouseClick, and MouseDoubleClick) do exist.

The *only* event that I subscribe to on the ComboBox is the
MouseDoubleClick event. I've read cases where the MouseDoubleClick
event is not raised when, for example, you subscribe to the Click event.
However, since I am not subscribed to anything else, I don't
understand why the event would not be raised.

Thank you again,

--
Sean
Sep 15 '06 #3

P: n/a
Hi again ok to make it easier...

Assuming you want the value of the combo at the point of change (when the
click a choice)

You want to double click the event that says SelectionValueChanged

Then do this int he method created

private void comboBox1_SelectedValueChanged(object sender, EventArgs e)

{

ComboBox senderComboBox = (ComboBox)sender;

MessageBox.Show(senderComboBox.Text);

}

Code above will fire a message box showing the value selected. Anything you
need you can access from the senderComboBox .

"senfo" <en**********@yahoo.comI-WANT-NO-SPAMwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Daniel wrote:
>"The ComboBox does not provide a DoubleClick event like other controls
do."
......and therein lies the answer.

every time you left click the WM_LBUTTONDBCLICK will fire, doesn't mean
your
combo is listening to it. You have to assign that event to the combo. In
visual studio this is really easy, in the designer click the combo, in
the
properties windo on the right click the lightening symbol and scroll down
to
the left click or whatever event it is (cant remember exact name of my
head)
and double click in there. it hooks the event and creates the method for
you. Put your code in that method .

Hi Daniel,

Thank you for your reply. The problem isn't with subscribing to the
event, the problem is that the event is never raised. Some controls
provide the "Action" events Click, DoubleClick, MouseClick, and
MouseDoubleClick. The MouseClick events are similar to the Click events;
however, the MouseEvent events have an extended EventArgs class for
providing more detail about the click. The ComboBox control does not
provide the DoubleClick event; however, the other three (Click,
MouseClick, and MouseDoubleClick) do exist.

The *only* event that I subscribe to on the ComboBox is the
MouseDoubleClick event. I've read cases where the MouseDoubleClick event
is not raised when, for example, you subscribe to the Click event.
However, since I am not subscribed to anything else, I don't understand
why the event would not be raised.

Thank you again,

--
Sean

Sep 15 '06 #4

P: n/a
Daniel wrote:
Hi again ok to make it easier...

Assuming you want the value of the combo at the point of change (when the
click a choice)

You want to double click the event that says SelectionValueChanged

Then do this int he method created

private void comboBox1_SelectedValueChanged(object sender, EventArgs e)

{

ComboBox senderComboBox = (ComboBox)sender;

MessageBox.Show(senderComboBox.Text);

}
Hi Daniel,

Thank you again for your reply. Unfortunately, this won't work for me.
I really need the double click event to be raised.

I read in a blog post somewhere that the ComboBox has an internal
TextBox, which "eats" the DoubleClick event. I have not confirmed this,
nor have I found a workaround other than using a timer.

Thank you again,

--
Sean
Sep 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.