I am trying to add the panel control the functionality of expanding and collapsing. My panel has a header, where the user should place a label with the title or an icon, and a body, where you can place controls as you do in standard panel. Both header and body have customizable gradient background.

That works, but then I have added a timer to the custom control to expand or collapse the body of the panel. It seems to work fine at design time, but at runtime the panel do not raise events. Even the controls you place on the panel appear as not enabled. I know the problem is the declaration of the timer "withevents". Is there a way to make it work including the timer in the custom control?

Thanks!