Hi, I'm having a bit of trouble with a user control I have made.
Basically each instance of this control contains a checkbox and a label etc... call it Option
Then I have a second control that is made up of a group of of these controls... call it OptionHolder
So in my form I add an OptionHolder
Then in the load method of the form i add options to the option holder...
which calls this method of the OptionHolder class
which all seems to work fine. Everything shows up as it should...
Now I wanted to add some logic to the checkbox being checked/unchecked event so in the Option class I have
When I fire up the option control on its own this works fine, and the message boxes get displayed when i check/uncheck any checkboxes.
However in the main app when I check/uncheck any of the boxes nothing happens?
I'm not sure at all what I'm doing wrong?
Any help greatly appreciated
Basically each instance of this control contains a checkbox and a label etc... call it Option
Then I have a second control that is made up of a group of of these controls... call it OptionHolder
So in my form I add an OptionHolder
Then in the load method of the form i add options to the option holder...
Code:
Dim test1 As New Option
test1.Setup("Option1", 1)
Me.OptionHolder1.AddOption(test2)
Code:
Sub AddOption(ByRef opOption As Option)
Me.pnlOptions.Controls.Add(opOption)
End Sub
Now I wanted to add some logic to the checkbox being checked/unchecked event so in the Option class I have
Code:
Public Sub chkBxOptionName_CheckChange(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkBxOptionName.CheckedChanged
If chkBxOptionName.Checked Then
MsgBox("Checked")
Else
MsgBox("Unchecked")
End If
End Sub
However in the main app when I check/uncheck any of the boxes nothing happens?
I'm not sure at all what I'm doing wrong?
Any help greatly appreciated