简体   繁体   中英

Form Load ComboBox DropDownList

what I'm trying to do is when program start to auto select value 0 or 1 from combobox1

ComboBox DropDownList: - Yes - ( Value 0 ) - No - ( Value 1 )

I try something like this, but didnt work

// ------------------- StartUP Load
private void Form1_Load(object sender, EventArgs e)
{
 comboBox4.SelectionStart = 0;
}

Try

comboBox4.SelectedIndex = 0;

That should start it at Yes. If you want to start it at No then use

comboBox4.SelectedIndex = 1;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM