コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
        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;
                }
            }
        }