var 
  mylabel:TLabel;
begin
  mylabel:=TLabel.creat(self);//self改form1也不行
  with mylabel do
  being
    left:=100;
    top:=100;
    width:=100;
    height:=100;
    caption:='good';
    show;
  end;
end;编译运行正常,就是没有显示。

解决方案 »

  1.   

    with mylabel do
      being
        parent:=self;
        left:=100;
        top:=100;
        width:=100;
        height:=100;
        caption:='good';
        show;
      end;
      

  2.   

    being
        Parent:=self; //!!
        left:=100;
        top:=100;
        width:=100;
        height:=100;
        caption:='good';
        //show;
      end;
      

  3.   

    改成如下的代码就可以了:var 
      mylabel:TLabel;
    begin
      mylabel:=TLabel.creat(self);
      with mylabel do
      being
        Name:='Label1';
        left:=100;
        top:=100;
        width:=100;
        height:=100;
        caption:='good';
        parent:=Self;
      end;
    end;
    需要指定控件的Parent属性。