I am using a ComboBox to insert a text template into a RichEdit control (the name of the template is in the picklist for the ComboBox.)
It all works great except when the user selects the same value in the list again. Then the SelectionChanged
is not firing. That makes sense based on the name of the event (SelectionChanged), but I need to know that the value was re-selected so I can insert it again.
Is there a way to know that an item was re-selected from the ComboBox? (Or a better control to use?)
I tried using the DropDownClosed
event, but that fires even if the item was not re-selected. (They open the drop down then click on another control.)
ComboBox. SelectedIndexChanged Event (System.
Selected and Current Item Text property of ComboBox represents the text of the current selected item in a ComboBox. SelectedItem represents the first item in the currently selected items in a ComboBox. SelectedValue represents the value of the currently selected item in a ComboBox.
cs to sniff PreviewMouseLeftButtonDownEvent for all ComboBoxItem , then trigger the SelectionChangedEvent if the selecting item is the same as the selected item, i.e. the selection is performed without changing index.
It sounds like the way you are using your combo box isn't consistent with normal usage. Would it work to have a button next to the combo box that inserted the selected template. I think that behavior would work better for users who are familiar with the behavior of Google search with search sugestions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With