I have problem with Frames and inheritance in Delphi 7.
Suppose I define a Frame with visible=false
(on design time).
Now I embed this frame in some Form, and set visible=true
on the embedded instance of the frame inside the form (also on design time).
Now suppose I want to initialize the embedded frame according to its visible property that was set in design time. The problem is that simple overriding the frame's constructor doesn't work, since inside the constructor I always get visible=false
(I guess because the DFM properties hasn't been read yet). I also don't want to put the initialization code inside the Form unit, because this logic belongs only to the Frame.
What is your best rule of thumb for dealing with such cases?
Clarification
Frame.Visible
is only an example. The question is relevant for all other properties of the Frame, or its inner components, that are set in design time. For example let's say we are talking about the color of TEdit inside the Frame.