Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Setting Combobox default item at Design time

$
0
0
Hello,

I added a combobox to my forms app, and set the Dropdown style as "DropDownList", so the user can't do anything but select a different item.

I know I can set a default item within the form constructor with the SelectedIndex, SelectedItem, etc properties. But I rather set the default to an item with "Select One" at design time, then I don't need to add a line of code every time I insert a ComboBox. So, any sugestion?

I tried using the Text property but it gets erased when I press enter after entering my "default text".

Thanks,
John

PS: My comboboxes aren't bound to anything their own collections.

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>