选择设置comboBox默认值

  
    
for ( int i = 1 ; i <= 10 ; i ++ )
{
string [] str = { " 项目 " + i};
foreach ( string s in str)
{
this .comboBox1.Items.Add(s.ToString());
}
}
// comboBox1.SelectedIndex = 2;
comboBox1.SelectedIndex = comboBox1.Items.IndexOf( " 项目2 " );


你可能感兴趣的:(combobox)