Click here to Skip to main content
15,665,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i would like to set my combobox's text as permenant

for an example in the early stage
combobox text is set as "please select your option here"
if i have select any option in the combobox
i don't want my combobox's text to be update as the selected option in combobox

but whenever i click option in combobox, my combobox's text will be update as what i have selected in combobox

What I have tried:

private void comboBox1_TextChanged(object sender, EventArgs e)
              comboBox1.text = "please select your option here" ;

after i add this code, it still update the text of combobox to the selected option
Updated 18-Apr-18 20:36pm

1 solution

You would have to set comboBox1.SelectedItem instead of comboBox1.Text.

But why do you use a ComboBox, when you don´t want the selection to change?
What UI-Framework are you using? WPF, WinForms?
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900