VisibleChanged don't raise when not visible

Viewed 1251

I'm working on c# WinForm.

I have an custom UserControl : MyControl : UserControl, INotifyPropertyChanged. I attached a method on event on event VisibleChanged : this.VisibleChanged += new System.EventHandler(this.MyControl_VisibleChanged);

My application have some pages, each page is a control like MyControl. Top of MainWindows contains Button, used to switch tab.

My problem is that my function MyControl_VisibleChanged is called only when Visible is changing to true. I added a test in a tab to check MyControl.Visible, when I select the other tab, MyControl.Visible is false but no event is raised.

I've try to define a new property Visible for this control but value is never set, only the base value is modify.

Can you help me to find a solution ?

1 Answers
Related