Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

When does TLMDockPanel.OnShow method get called?

Hello!

I'm trying to add a form dynamically to tabbed TLMDockPanel on it's first showing for lazy creation.

I expected that TLMDockPanel.OnShow will work like TPageControl's TTabSheet.OnShow but it didn't.
Is it bug or how can I do that?
Tagged:

Comments

  • 2 Comments sorted by Votes Date Added
  • Posts: 0 Accepted Answer Vote Up0Vote Down
    Hi,

    OnShow event is fired when PanelVisible property changes its value. But, since PanelVisible value is True by default, this value is not changed on initialal layout loading (it remains True); so, OnShow event is not fired.

    Another one problem is, when exactly OnShow should be fired during initialization. Firing it too early will not help, but actually, panels become visible too early...

    So, the best way for you is to iterate all visible panels and fire their OnShow events manually. You can do this, for example, in your main form's OnShow event handler. Actually, this is much clear way, and you will be sure, that whole form is already loaded and initialized.
Sign In or Register to comment.