Beispiel #1
0
 /// <summary>
 /// Handles the Load event of the UCRadioButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 private void UCRadioButton_Load(object sender, EventArgs e)
 {
     if (this.Parent != null && this._checked)
     {
         foreach (Control c in this.Parent.Controls)
         {
             if (c is UCRadioButton && c != this)
             {
                 UCRadioButton uc = (UCRadioButton)c;
                 if (_groupName == uc.GroupName && uc.Checked)
                 {
                     Checked = false;
                     return;
                 }
             }
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Sets the check.
 /// </summary>
 /// <param name="bln">if set to <c>true</c> [BLN].</param>
 private void SetCheck(bool bln)
 {
     if (!bln)
     {
         return;
     }
     if (this.Parent != null)
     {
         foreach (Control c in this.Parent.Controls)
         {
             if (c is UCRadioButton && c != this)
             {
                 UCRadioButton uc = (UCRadioButton)c;
                 if (_groupName == uc.GroupName && uc.Checked)
                 {
                     uc.Checked = false;
                     return;
                 }
             }
         }
     }
 }