title: Delphi: How to show a compound component?
body: <p>I have a check box control with a labeled edit as a published subcomponent.</p>
  
  <p>What I'm trying to do is create a Translate procedure for the check box that would show the labeled edit on top, and allow the user to change the text of the check box's caption. Something like this:</p>
  
  <pre><code>constructor TPBxCheckBox.Create(AOwner: TComponent);
  begin
    inherited Create(AOwner);
    FTranslateEdit := TLabeledEdit.Create(Self);
    FTranslateEdit.Parent := Self.Parent;
    FTranslateEdit.SetSubComponent(True);
    FTranslateEdit.Visible := False;
  end;    
  
  procedure TPBxCheckBox.Translate(Show: Boolean);
  begin
    TranslateEdit.Left := Self.Left;
    TranslateEdit.Top := Self.Top;
    TranslateEdit.EditLabel.Caption := Self.Caption;
    TranslateEdit.Text := Self.Caption;
    TranslateEdit.Visible := Show;
    TranslateEdit.Width := Self.Width;
  end;
  </code></pre>
  
  <p>But this doesn't work - the labeled edit is never shown.</p>
  
  <p>What am I doing wrong here?</p>