Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# How to set default value of a string collection in Design

In WinForm, I have a combobox with DropDownStyle set to DropDownList (so can't enter a Text). In the properties window, there is the Items property which is a string collection. I enter all my values.

But now, I would like to set one of these value by default (instead to have the empty entry at run-time). I know how to do this via coding, but I am pretty sure (damn memory) that it was possible to set one of the value in the string collection as default by adding a special symbole in front of the line.

Anybody know that symbole? Or my memory is playing me trick and it is not possible to do it via the designer?

like image 446
Wildhorn Avatar asked Nov 14 '22 08:11

Wildhorn


1 Answers

Doesn't look like it can be done when using a DropDownList. From here it is suggested that you can set the text property to the default value you want, but this will only works in a DropDown rather than DropDownList style.

like image 169
Martin Harris Avatar answered Mar 09 '23 01:03

Martin Harris