Detecting a ComboBox selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

(This was first posted in the VB newsgroup, but I got the impression that is
really for VB6 so I'm posting it here, too.)

We have an application that is used to edit properties of a .NET form. It
looks sort of like the .NET IDE, but is just for basically alterinf visyal
attributes on the form.

When you select a control (e.g., text box or label) you see some of ist
properties in a PropertyGrid control and the name of the selected control in
a ComboBox control we have off to the side. This all works fine.

However, if one uses the ComboBox to select from a list of the available
controls on the form, we don't seem to be able to detect this happening so we
can't select the control on the form corresponding to the one selected by the
ComboBox.

Is there an event or some other "thing" we can use to tell us a selection
was made with the ComboBox so we can then get that selection from the
ComboBox and then highlight the control on the form? Any ideas or
suggestions?
 
Hi,

Currently I am finding one support professional for you on this issue. When
any update, we will reply here at the first time.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance.
 
uh?
what about
ComboBox.SelectedValueChanged ?
ComboBox.SelectedIndexChanged?
ComboBox.TextChanged?
PayCheck.Increased?
 
Hi

Did Lloyd's suggestion helps you?
For a .NET winform ComboBox control, we have two events will fired when you
change selected item in the combo box.
SelectedIndexChanged Occurs when the SelectedIndex property has changed.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWindowsFormsComboBoxClassSelectedIndexChangedTopic.asp

SelectedValueChanged (inherited from ListControl) Occurs when the
SelectedValue property changes.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWindowsFormsListControlClassSelectedValueChangedTopic.asp

Here is a link about all the events about ComboBox.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWindowsFormsComboBoxEventsTopic.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Peter Huang" said:
For a .NET winform ComboBox control, we have two events will fired when you
change selected item in the combo box.
SelectedIndexChanged Occurs when the SelectedIndex property has changed.

Except of course when an item is curently selected, and you .Clear the
..Items collection, which will make 'SelectedIndex' 'change' to -1, but
without firing SelectedIndexChanged. Perhaps the event should be named
SelectedIndexChangedToSomethingOtherThanNegativeOne.

Oh, and if you have an item currently selected, drop down the list with
the mouse, and click the currently selected item, 'SelectedIndex' will
not 'change', but SelectedIndexChanged will fire. Perhaps the event
should be named
SelectedIndexRemainedTheSameOrChangedToSomethingOtherThanNegativeOne.
 
Thanks, Larry! You have an interesting sense of humor re what the controls
really do and the corresponding effects on their names! Much more
self-defining, but long to type!
 
Back
Top