F
F
Frip2018-11-29 16:33:58
WPF
Frip, 2018-11-29 16:33:58

How to unselect (make default) combobox?

There is some combobox, in the course of the program I select values ​​from the collection that I myself set.
When moving to the next stage, I want the combobox to become again without the selected element . The
Internet prompted for such a solution . Thus, going beyond the borders and removing the selection. BUT! This does not work in my program, because setting the index "-1" calls the function Through which I have the main operations, thus I can not use the above method. Maybe there is some other way?
combobox1.SelectedItem = -1;
comboBox1_SelectedIndexChanged

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
baimkin, 2018-11-29
@mrFrip

comboBox1_SelectedIndexChanged
if (combobox1.SelectedIndex == -1) return;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question