首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

怎么写这样的Panel 控件

2013-01-11 
如何写这样的Panel 控件?由于业务的关系,将餐台面信息放在Panel 上,再将所有的餐台(Panel)放在Form上,象这

如何写这样的Panel 控件?
由于业务的关系,将餐台面信息放在Panel 上,再将所有的餐台(Panel)放在Form上,
象这样怎么写这样的Panel 控件

把它写成一个component, 遇到了问题,放在Panel上的Label出不来,和普通的Panel一样

关键代码如下:
  TShowPanel = class(TPanel)
  private

    TableLabel: TCustomLabel;
    TableText: TCustomLabel;
    FTableText: string;
....


constructor TShowPanel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  Font.Style := [fsUnderline];
  TableLabel := TCustomLabel.Create(self);
  with TableLabel do
  begin
    Parent := Parent;
    Caption := '台号';
    Top := 15;
    Height := 20;
    Visible := true;
  end;

  TableText := TCustomLabel.Create(self);
  with TableText do
  begin
    Parent := Parent;
    Caption := '23';
    Top := 15;

    Height := 20;
    Visible := true;
  end;

end;



刚学写控件,向高手请教

panel ?component
[解决办法]
//Parent := Parent;
Parent := self;

热点排行