C#, fire event of container

I have a MyButton class that inherits from Button. On this class I have placed several other controls (Labels, Progessbar). The problem with this is that the controls on the Button make it impossible to fire the Button.Click or Button.MouseHover event. How can I achieve it that the controls on the Button are only displayed but are "event transparent": A click/hover on the label and progessbar is the same as if I clicked/hover directly on the Button (including sender and everything). Something like "inheriting the events from the parent".

class MyButton : Button
{
    Label foo = new Label();
    ProgressBar bar = new ProgessBar();
}
6
задан blubberbernd 22 March 2011 в 16:39
поделиться