title: How to Create Event for Dynamic Control Array in VB.NET
body: <p>I'm trying to create an array of checkboxes dynamically and also want to put event to those checkboxes. How can I do this?</p>
  
  <p>For example:</p>
  
  <p>I have a array of checkboxes - Chk1, Chk2.</p>
  
  <p>I want it to work this way: When I check Chk1, I want to disable Chk2, and when Chk1 is unchecked, Chk2 is enable, and vice versa.</p>
  
  <p>Your input is greately appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>P.S.: The code is in VB.NET. Thanks.</p>
  
  <hr>
  
  <p>Thank you all for the inputs. I really appreciated it. Maybe I wasn't very clear on my explanation earlier. </p>
  
  <p>Let's say, I have an array of 6 checkboxes, and I want them to behave in group like this:</p>
  
  <ul>
  <li><p>When Chk1 is checked, Chk2 is disabled (grey out), and when we uncheck Chk1, Chk2 is enabled, and Vice Versa.</p></li>
  <li><p>When Chk3 is checked, Chk4 is disabled, and when we uncheck Chk3, Chk4 is enabled, and Vice Versa.</p></li>
  </ul>
  
  <p>and so on....</p>
  
  <p>So this is like each pair of checkboxes in the array perform the CheckChanged event upon each other, but not on any other pair. So I think OptionButton is not the case in this situation.</p>
  
  <p>Thanks for any suggestions.</p>