I have one sub where I dynamically create checkboxlist items...
Dim chk As New CheckBox
With chk
AddHandler chk.CheckStateChanged, AddressOf chkBox_CheckedChanged
.Name = strName
In that checkstatechanged event, I'm trying to set another created control's name based off the checkbox's name:
Private Sub chkBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim cbo as New CustomCombo
cbo.Name = "Primary " & chkBox.Name
but that gives me the error: Name 'chkbox' is not declared
How can I get around this?
Private Sub chkBox_CheckedChanged(ByVa
Dim cbo as New CustomCombo
Dim chkBox As CheckBox = DirectCast(sender, CheckBox)
cbo.Name = "Primary " & chkBox.Name