Hi

ive dynamically added a few controls to a dynamic panel control at runtime. Ive set up the events i need to use the controls but I would like to do something to the controls parent panel.

Im trying to set the panels control backcolor to blue using my dynamically created controls.


I want to do something like this
VB Code:
  1. Private Sub CheckBox_Changed(ByVal sender As Object, ByVal e As System.EventArgs)
  2.         sender.parentcontrol.backcolor = Color.Blue
  3.     End Sub

but that obviously doesn't work