Показать сообщение отдельно
  #7  
Старый 09.01.2013, 09:11
Аватар для NumLock
NumLock NumLock вне форума
Let Me Show You
 
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
Радость

Form1.GroupBox1.Label1.Caption:='Hobbit';
Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TGroupBox = class(StdCtrls.TGroupBox)
  public
    Label1: TLabel;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TGroupBox1 }

constructor TGroupBox.Create(AOwner: TComponent);
begin
  inherited;
  Label1:=TLabel.Create(Self);
  Label1.Parent:=Self;
  Label1.Left:=10;
  Label1.Top:=20;
  Label1.Caption:='Label1';
end;

destructor TGroupBox.Destroy;
begin
  Label1.Free;
  inherited;
end;

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form1.GroupBox1.Label1.Caption:='Hobbit';
end;

end.
__________________
Пишу программы за еду.
__________________
Ответить с цитированием