There are two possible ways that I could think of:
A) Use the WinForms Combobox Sorted
Property
If you're using WinForms, you can use ComboBox.Sorted = true;
B) Manually Sort your List with OrderBy
If the data in your combo box comes from in a form of a list, use OrderBy to the List
of data you are going to put in the ComboBox
before setting it.
Here's an example:
var myList = new List<string>() {"q","w","e","r","t","y"};
var sorted = a.OrderBy(c => c).ToArray()
comboBox1.Items.AddRange(sorted);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…