I think ,you should move the visible code:
try this:
constructor TFLEdit.Create(AOwner: TComponent);
const
  Gap = 5;
begin
  inherited;
  Width := 200;
  Height := 25;  FLabel := TLabel.Create(Self);
  FLabel.AutoSize :=true;
  FLabel.Parent := Self;
  FLabel.Caption := 'Temp';
  FLabel.Left := Gap;
  FLabel.Top := Gap;
  FLabel.Width := 55;
  FLabel.Height := 15;
  //FLabel.Visible := True;
  FEdit := TFlatEdit.Create(Self);
  FEdit.Parent :=Self;
  FEdit.Left := FLabel.Left+FLabel.Width+3;
  FEdit.Top := FLabel.Top-3;
  FEdit.Width := Width - FEdit.Left - Gap;
  //FEdit.Visible := True;
end;

解决方案 »

  1.   

    那有什么用呢?如果FEdit.Visible := True;去掉的话
      

  2.   

    chechy(我爱洁洁) 
      谢谢您,您还在吗?
      

  3.   

    如果还有问题,那么在创建的时候在加上:
    FLabel.Name := 'MyLabel';
    FEdit.Name := 'MyEdit';
    这样出错时候就比较好诊断哪个控件有问题。
      

  4.   

    出错在:
      FEdit := TFlatEdit.Create(Self);(可能是没有父控件)
      FEdit.Parent :=Self;
      FEdit.Left := FLabel.Left+FLabel.Width+3;
      FEdit.Top := FLabel.Top-3;
      FEdit.Width := Width - FEdit.Left - Gap;
      //FEdit.Visible := True;
      

  5.   

    出错提示:control '' has no parent window. 
    如果把TFLATEDIT换成TEDIT就可以了不知为什么?
      

  6.   

    你的TFLATedit在做的时间是不是没有继承?
      

  7.   

    我是用那个著名的控件Flatstyle来做的.
      

  8.   

    是不是create里的inherited 应该改成 inherited Create(AOwner);
    试一试!
      

  9.   

    各位,大家辛苦了,
    我已经在create里改成了 inherited Create(AOwner);
    还是不行?
      

  10.   

    感觉应该是self的含义没有搞清楚
      FEdit := TFlatEdit.Create(Self);  FLabel := TLabel.Create(Self);
      FLabel.AutoSize :=true;
      FLabel.Parent := Self;
      
      FEdit.Parent :=Self;
      FEdit.Left := FLabel.Left+FLabel.Width+3;
      FEdit.Top := FLabel.Top-3;
      FEdit.Width := Width - FEdit.Left - Gap;
    你在这个控件的create过程里设定flabel及fedit的parent是什么意思???
      

  11.   

    定义一下这个过程
    procedure CreateWND(); override;
    begin
      FLabel := TLabel.Create(Self);
      FLabel.AutoSize :=true;
      FLabel.Parent := Self;
      FLabel.Caption := 'Temp';
      FLabel.Left := Gap;
      FLabel.Top := Gap;
      FLabel.Width := 55;
      FLabel.Height := 15;
      FLabel.Visible := True;
      FEdit := TFlatEdit.Create(Self);
      FEdit.Parent :=Self;
      FEdit.Left := FLabel.Left+FLabel.Width+3;
      FEdit.Top := FLabel.Top-3;
      FEdit.Width := Width - FEdit.Left - Gap;
      FEdit.Visible := True;end;在create中只要现在的前三句。
    我现在不方便打开delphi。所以看不出来效果。如果正确请给我发一个mail:
    [email protected]