M
Mark
I have a form which during the load event creates 1 or more checkboxes.
Also, as each checkbox is added to the controls collection I also add a
handler:
AddHandler o.Click, AddressOf MedicationStop_Click
So, all of the checkboxes use the same handler
That part seems to go well. However, if a user actually checks or unchecks
one or more of the boxes, I can't seem to determine which boxes are checked
or their checked state. Can someone show me the error of my ways? Here is
my handler..
Private Sub MedicationStop_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim o As Control
'Need to show/hide a corresponding combobox depending on the checked
state
For Each o In pnlMeds.Controls
If TypeOf (o) Is CheckBox Then
'How do I determine:
'A. Which combobox was clicked
'B. What is the CheckedState
'There is no o.CheckedState property!
End If
Next
End Sub
Also, as each checkbox is added to the controls collection I also add a
handler:
AddHandler o.Click, AddressOf MedicationStop_Click
So, all of the checkboxes use the same handler
That part seems to go well. However, if a user actually checks or unchecks
one or more of the boxes, I can't seem to determine which boxes are checked
or their checked state. Can someone show me the error of my ways? Here is
my handler..
Private Sub MedicationStop_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim o As Control
'Need to show/hide a corresponding combobox depending on the checked
state
For Each o In pnlMeds.Controls
If TypeOf (o) Is CheckBox Then
'How do I determine:
'A. Which combobox was clicked
'B. What is the CheckedState
'There is no o.CheckedState property!
End If
Next
End Sub