I am new at C# and it seems the following code below does not seem to select my combobox value:
Code:
    private void button1_Click(object sender, EventArgs e)
    {
       cbPortNumber.SelectedIndex = 3;
    }
The dropdown looks like this:


All code above does not seem to select HDMI 4 on the list... The error i have is:

System.ArgumentOutOfRangeException: InvalidArgument=Value of '2' is not valid for 'SelectedIndex'. Parameter name: SelectedIndex at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)

Any help would be great!

**update showing combobox**


Code:
        // 
        // cbPortNumber
        // 
        this.cbPortNumber.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
        this.cbPortNumber.Enabled = false;
        this.cbPortNumber.FormattingEnabled = true;
        this.cbPortNumber.Location = new System.Drawing.Point(174, 40);
        this.cbPortNumber.Name = "cbPortNumber";
        this.cbPortNumber.Size = new System.Drawing.Size(133, 21);
        this.cbPortNumber.TabIndex = 11;
        this.cbPortNumber.Text = "global_hdmi_port";
        this.helpPortNumber.SetToolTip(this.cbPortNumber, "The HDMI port number, to which you connected your USB-CEC adapter.");
        this.cbPortNumber.SelectedIndexChanged += new System.EventHandler(this.cbPortNumber_SelectedIndexChanged);
Code:
    #region Global settings
    public CECSettingByte HDMIPort
    {
      get
      {
        if (!_settings.ContainsKey(KeyHDMIPort))
        {
          CECSettingByte setting = new CECSettingByte(KeyHDMIPort, "HDMI port", 1, _changedHandler) { LowerLimit = 1, UpperLimit = 15, EnableSetting = EnableHDMIPortSetting };
          setting.Format += delegate(object sender, ListControlConvertEventArgs args)
          {
            ushort tmp;
            if (ushort.TryParse((string)args.Value, out tmp))
              args.Value = "HDMI " + args.Value;
          };

          Load(setting);
          _settings[KeyHDMIPort] = setting;
        }
        return _settings[KeyHDMIPort].AsSettingByte;
      }
    }
And this is what fires the action after selecting something in that dropdown:
Code:
    private void OnSettingChanged(CECSetting setting, object oldValue, object newValue)
    {
      if (setting.KeyName == CECSettings.KeyHDMIPort)
      {
        CECSettingByte byteSetting = setting as CECSettingByte;
        if (byteSetting != null)
        {
          if (!Settings.OverridePhysicalAddress.Value)
            Config.HDMIPort = byteSetting.Value;
          CECActions.SetConnectedDevice(Settings.ConnectedDevice.Value, byteSetting.Value);
        }
      }