I need to make a combobox with hint text "Pick a Value"
and when start typing the value to be cleared and when its null to change the Combobox's text to Pick Value
In Form Load
comboBox1.Text = "Pick a Value";
comboBox1.SelectedIndex = -1;
The problem here is that the cusrsor position doesnt work. It selects all my text
In TextChanged
private void comboBox1_TextChanged(object sender, EventArgs e)
{
if (comboBox1.Text.Length == 0)
{
comboBox1.Text = "Pick a Value";
}
}
I need this code be working only if user clears the Combobox with backspase not if i will use ComboBox.Text = ""
in mouse click;
example
private void comboBox1_MouseClick(object sender, MouseEventArgs e)
{
//This conflicts the comboBox1_TextChanged event
comboBox1.Text = "";
}
And in the end i need a code to clearing text if user start typing.