Why compiler execute OnShow event first and OnHide later in TTabSheet?

215 Views Asked by At

I'm using a TPageControl with 2 TTabSheet (ModifyTab and DeleteTab) and I have code in OnShow and OnHide events for both tabs . I was thinking that when I clicks anyone of these tabs, OnHide event of the selected Tab occurs first and clicked tab´s OnShow event later but it´s the opposite. Why's that?

I create a TDictionary in every OnShow event and free in every OnHide but compiler raises an exception because it executes OnShow event, then executes OnHide and then I can't use the Dictionary because it's nil and destroyed.

0

There are 0 best solutions below