public attSelectiveListeningRetrievePopupForm(Csta.ConnectionID_t[] conns) { this._conns = conns; InitializeComponent(); for (int i = 0; (i < conns.Length) && (i < 10); i++) { var rb = new RadioButtonConn(); rb.Location = new System.Drawing.Point(7, 20 * (i + 1)); rb.TabIndex = i + 1; rb.Text = conns[i].deviceID.ToString(); rb.Connection = conns[i]; rb.CheckedChanged += new System.EventHandler(this.rb1_CheckedChanged); var rb2 = new RadioButtonConn(); rb2.Location = new System.Drawing.Point(7, 20 * (i + 1)); rb2.TabIndex = i + 1; rb2.Text = conns[i].deviceID.ToString(); rb2.Connection = conns[i]; rb2.CheckedChanged += new System.EventHandler(this.rb2_CheckedChanged); this.connGroupBox1.Controls.Add(rb); this.connGroupBox2.Controls.Add(rb2); } var selected1 = (RadioButtonConn)this.connGroupBox1.Controls[0]; selected1.Checked = true; var selected2 = (RadioButtonConn)this.connGroupBox2.Controls[1]; selected2.Checked = true; }
public attSelectiveListeningRetrievePopupForm(Csta.ConnectionID_t[] conns) { this._conns = conns; InitializeComponent(); for (int i = 0;(i < conns.Length) && (i < 10) ; i++) { var rb = new RadioButtonConn(); rb.Location = new System.Drawing.Point(7, 20 * (i + 1)); rb.TabIndex = i + 1; rb.Text = conns[i].deviceID.ToString(); rb.Connection = conns[i]; rb.CheckedChanged += new System.EventHandler(this.rb1_CheckedChanged); var rb2 = new RadioButtonConn(); rb2.Location = new System.Drawing.Point(7, 20 * (i + 1)); rb2.TabIndex = i + 1; rb2.Text = conns[i].deviceID.ToString(); rb2.Connection = conns[i]; rb2.CheckedChanged += new System.EventHandler(this.rb2_CheckedChanged); this.connGroupBox1.Controls.Add(rb); this.connGroupBox2.Controls.Add(rb2); } var selected1 = (RadioButtonConn)this.connGroupBox1.Controls[0]; selected1.Checked = true; var selected2 = (RadioButtonConn)this.connGroupBox2.Controls[1]; selected2.Checked = true; }