ComboBox中设置默认值

可以在窗体载入事件中(  private void XXX_Load(object sender, EventArgs e)),设置ComboBox的SelectedIndex属性为相关的索引值。

如:

private void XXX_Load(object sender, EventArgs e)
        {
            this.cmb_ComPorts.SelectedIndex = 0;
            this.cmb_BaudRate.SelectedIndex = 6;
            this.cmb_DataBits.SelectedIndex = 0;
            this.cmb_StopBits.SelectedIndex = 0;
            this.cmb_Parity.SelectedIndex = 0;
        }


你可能感兴趣的:(object)