title: How to capture event of multiple Dynamic control in VB6.0
body: <p><a href="http://i.stack.imgur.com/qRX65.png" rel="nofollow">Screenshot</a></p>
  
  <p>In the above form, I have an SSTab. The Add Characteristics button is an added control to create rows of characteristics. On click of this button, I can keep adding Dynamic controls (Checkbox, Label, Text, Combobox and other controls.) Now I want to capture the Action. for Example, change of Text in Combobox or Change in CheckBox Status. I am not able to trap the Event to identify which control and what code will help me capture the action of a Dynamic Control (on the first Tab)</p>
  
  <p>Can some one help me with a good solution? I have been desperately searching for over a month and have not got a solution so far.</p>
  
  <p>Let me know how I can send the VB code as a ZIP file for reference over email.</p>
  
  <p>Expectation:<br>
  1. I should be able to capture delete Row change in the check box<br>
  2. I should be able to capture changes in Combo box </p>
  
  <p>Static Controls:<br>
  1. Form:        frmcharacteristics<br>
  2. Button: cmdAddCharacteristics<br>
  3. SSTab:   tabDisplay</p>
  
  <p>Code in Module1:</p>
  
  <pre><code>Public SR_NO As Long
  Public Top_Position As Long
  </code></pre>
  
  <p>code in frmCharacterisitcs: </p>
  
  <pre><code>Option Explicit
  Dim WithEvents Ch_Delete_Row As CheckBox
  Dim WithEvents Ch_SR_NO As Label
  Dim WithEvents Ch_Name As TextBox
  Dim WithEvents Ch_Type As ComboBox
  
  Dim WithEvents Extended_Control As VBControlExtender
  
  
  Private Sub cmdAddCharacteristics_Click()
  
      Module1.SR_NO = Module1.SR_NO + 1
      Set Ch_Delete_Row = frmCharacteristics.Controls.Add("VB.CheckBox", "Ch_Delete_Row" &amp; (Module1.SR_NO), tabDisplay)
      Ch_Delete_Row.Visible = True
      Ch_Delete_Row.Top = Module1.Top_Position + 100
      Ch_Delete_Row.Width = 1000
      Ch_Delete_Row.Left = 500
      Ch_Delete_Row.Caption = ""
      Ch_Delete_Row.Height = 315
      'MsgBox Ch_Delete_Row.Name
  
      Set Ch_SR_NO = frmCharacteristics.Controls.Add("VB.Label", "Ch_SR_NO" &amp; (Module1.SR_NO), tabDisplay)
      Ch_SR_NO.Visible = True
      Ch_SR_NO.Top = Module1.Top_Position + 200
      Ch_SR_NO.Width = 750
      Ch_SR_NO.Left = Ch_Delete_Row.Left + Ch_Delete_Row.Width + 400
      Ch_SR_NO.Caption = Module1.SR_NO
      Ch_SR_NO.Height = 315
  
      Set Ch_Name = frmCharacteristics.Controls.Add("VB.TextBox", "Ch_Name" &amp; (Module1.SR_NO), tabDisplay)
      Ch_Name.Visible = True
      Ch_Name.Top = Module1.Top_Position + 100
      Ch_Name.Width = 2000
      Ch_Name.Left = Ch_SR_NO.Left + Ch_SR_NO.Width + 200
      Ch_Name.Text = ""
      Ch_Name.Height = 315
  
      Set Ch_Type = frmCharacteristics.Controls.Add("VB.ComboBox", "Ch_Type" &amp; (Module1.SR_NO), tabDisplay)
      Ch_Type.Visible = True
      Ch_Type.Top = Module1.Top_Position + 100
      Ch_Type.Width = 1500
      Ch_Type.Left = Ch_Name.Left + Ch_Name.Width + 50
      Ch_Type.Text = ""
      'Ch_Type.Height = 315
      Ch_Type.AddItem "Service"
      Ch_Type.AddItem "Special"
      Ch_Type.AddItem "Option"
  
      Module1.Top_Position = Module1.Top_Position + 400
  End Sub
  
  Private Sub Form_Load()
      Module1.SR_NO = 0
      Dim Test_Line As Control
      Set Test_Line = frmCharacteristics.Controls.Add("VB.Line", "LINE", frmCharacteristics)
      Test_Line.Visible = True
      Test_Line.X1 = 100
      Test_Line.Y1 = 600
      Test_Line.X2 = frmCharacteristics.Width
      Test_Line.Y2 = 600
      Top_Position = Test_Line.Y1
      frmCharacteristics.Show
      tabDisplay.Width = frmCharacteristics.Width - 1000
      tabDisplay.Height = frmCharacteristics.Height - 1500
      tabDisplay.Left = frmCharacteristics.Left + 200
      Call set_labels
  
  
  End Sub
  
  
  Sub set_labels()
  
      Dim Label_SR_NO As Control
      Dim Label_Name As Control
      Dim Label_Delete_Row As Control
      Dim Label_Type As Control
  
      Set Label_Delete_Row = frmCharacteristics.Controls.Add("VB.Label", "Label_Delete_Row" &amp; (Module1.SR_NO), tabDisplay)
      Label_Delete_Row.Visible = True
      Label_Delete_Row.Top = Module1.Top_Position + 100
      Label_Delete_Row.Width = 1000
      Label_Delete_Row.Left = 300
      Label_Delete_Row.Caption = "Delete(Y/N)"
      Label_Delete_Row.Height = 315
  
      Set Label_SR_NO = frmCharacteristics.Controls.Add("VB.Label", "Label_SR_NO" &amp; (Module1.SR_NO), tabDisplay)
      Label_SR_NO.Visible = True
      Label_SR_NO.Top = Module1.Top_Position + 100
      Label_SR_NO.Width = 750
      Label_SR_NO.Left = Label_Delete_Row.Left + Label_Delete_Row.Width + 400
      Label_SR_NO.Caption = "SR_NO"
      Label_SR_NO.Height = 315
  
      Set Label_Name = frmCharacteristics.Controls.Add("VB.Label", "Label_Name" &amp; (Module1.SR_NO), tabDisplay)
      Label_Name.Visible = True
      Label_Name.Top = Module1.Top_Position + 100
      Label_Name.Width = 2000
      Label_Name.Left = Label_SR_NO.Left + Label_SR_NO.Width + 400
      Label_Name.Caption = "Characteristics Name"
      Label_Name.Height = 315
  
      Set Label_Type = frmCharacteristics.Controls.Add("VB.Label", "Label_Type" &amp; (Module1.SR_NO), tabDisplay)
      Label_Type.Visible = True
      Label_Type.Top = Module1.Top_Position + 100
      Label_Type.Width = 1500
      Label_Type.Left = Label_Name.Left + Label_Name.Width + 50
      Label_Type.Caption = "Charac. Type"
      Label_Type.Height = 315
  
      Module1.Top_Position = Module1.Top_Position + 400
  End Sub
  </code></pre>