0

У меня создаются по нажатию на кнопку контролы, два TextBox Вопрос: как мне получить значение нужного контрола? Если допустим, они создаются и у каждого индивидуальное название типо

  • CheckBox1
  • CheckBox2
  • CheckBox3
  • и т.д.

Как получить Text с обычного CheckBox я знаю, но тут идёт речь идёт о динамических контролах. Пример кода

Dim enter1 As New CheckBox
With enter1
   .Top = pos_enter
   .Left = 458
   .Name = "CheckBox" & count_stringbind
End With
Me.Controls.Add(enter1)
AddHandler enter1.CheckedChanged, AddressOf enter_checked

Sub enter_checked(ByVal sender As Object, ByVal e As EventArgs)
'пусто'
End Sub

1 ответ 1

1
Sub enter_checked(ByVal sender As Object, ByVal e As EventArgs)
  Dim enter1 As CheckBox = CType(sender, CheckBox)
  // enter1.Text
  // enter1.Checked
End Sub

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.