private void refreshComboBoxCurrentHost() { if (comboBoxCurrentHost.InvokeRequired) { refreshComboBoxCurrentHostDelegate d = new refreshComboBoxCurrentHostDelegate(refreshComboBoxCurrentHost); this.Invoke(d); } else { comboBoxCurrentHost.Items.Clear(); comboBoxCurrentHost.Items.Add("localhost(127.0.0.1)"); foreach (HostList item in hostList) { comboBoxCurrentHost.Items.Add(item.HostName + "(" + item.HostAddress + ")"); } try { comboBoxCurrentHost.SelectedIndex = seleceHostIndex; } catch { comboBoxCurrentHost.SelectedIndex = 0; } } }