1

How can my TControl descendant get notified when its Parent Form in Showing i.e. the Parent Form DoShow method is called?

Is there a message being broadcast to the children (and children or children) when that occurs?

In my specific case, it is a TCustomControl (not TGraphicsControl). so maybe it will be easier?

Thanks.

zig
  • 4,524
  • 1
  • 24
  • 68
  • 1
    There's `CM_SHOWINGCHANGED` but it will be sent only when `Showing` is changed. Practically only the first time the control is shown (i.e. not when the form is hidden and shown again). Would you like to tell about the 'X' issue? – Sertac Akyuz Jul 03 '17 at 19:18
  • 1
    @SertacAkyuz, `CM_SHOWINGCHANGED` will be sent by the form to my control? and BTW, why the downvote? – zig Jul 03 '17 at 19:31
  • @SertacAkyuz, the "X" issue is this: https://www.experts-exchange.com/questions/22450671/Automatically-center-components-on-my-form-upon-maximizing.html#a18748856 – zig Jul 03 '17 at 19:45
  • I want to do a similar control but to call `RegisterPositions` from within my `TAlignPanel`. note the comment: `You have to call the AlignPanel.Registerpositions in your formshow event` – zig Jul 03 '17 at 19:47
  • A wincontrol, in its `UpdateShowing`, calls its children to `UpdateShowing`. If `Showing` is changed, then the message is performed. – Sertac Akyuz Jul 03 '17 at 20:06
  • Difficult to see the connection between showing a form and sizing it. – David Heffernan Jul 03 '17 at 20:09
  • Yep, rather looks like an alignment problem. – Sertac Akyuz Jul 03 '17 at 20:10
  • 1
    @David, When the form is first shown, the panel stores ** initial** position of the panel child controls. then when it is resized the controls are scaled. – zig Jul 03 '17 at 20:11
  • Sounds to me like the work is best done by the form – David Heffernan Jul 04 '17 at 11:45

0 Answers0