title: How do I set properties of a frame based on properties of its child components?
body: <p>My first version of this question may have been to specific, so I will try to ask in a more general way:</p>
  
  <p>I have a frame with a component on it, let's say it's a TButton. After placing the frame on the form I change a property of the component, let's say I set the tag on the button to 100. </p>
  
  <p>In the frames' constructor I would like to do something like this:</p>
  
  <pre><code>constructor TMyFrame.Create(AOwner: TComponent);
  begin
    inherited;
  
    if Button1.Tag = 100
      then DoSomething
      else DoSomethingElse;
  end;
  </code></pre>
  
  <p>I found out that at this time (during creation) the tag of the button is still 0. Can someone recommend another way to do this? </p>
  
  <p><s>
  In our application there are several places where the users can enter SQL statements. To facilitate this we use the <a href="http://sourceforge.net/apps/mediawiki/synedit/index.php?title=SynEdit_Home_Page" rel="nofollow">SynEdit</a> component. We have created a frame for this purpose, with some extended functionality.</p>
  
  <p>Sometimes we need the data-aware version (TDBSYnEdit), and at other times we need the "regular" version (TSynEdit). We have solved this by having a pagecontrol on the frame, and switch to the correct page at design time. The tabs are hid, so the user has no idea this happens. </p>
  
  <p>The problem is that sometimes our developers forget to set the correct page on the page control, or accidentaly selects the wrong page. </p>
  
  <p>I wanted to fix this by adding the following code to the Create event on the frame</p>
  
  <pre><code>if DBSQLMemo.DataField &gt; ''
    then pcMemos.ActivePage := tsDataAware
    else pcMemos.ActivePage := tsNonDataAware;
  </code></pre>
  
  <p>My theory was that if a developer set the datasource/datafield properties of the editor the frame should be used in "data-aware mode", and the data-aware editor should be visible. As it turns out, at the moment of creation these properties aren't set.</p>
  
  <p>Does anyone have a good suggestion to how I should solve this problem?
  </s></p>