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

Код:
unit Unit1;

interface

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

type
  TMetro2033 = class
  private
    FParent: TWinControl;
    FCaption: String;
    procedure SetCaption(Value: String);
  public
    property Caption: String read FCaption write SetCaption;
    constructor Create(AParent: TWinControl);
  end;

  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TMetro2033 }

constructor TMetro2033.Create(AParent: TWinControl);
begin
  inherited Create;
  FParent:=AParent;
end;

procedure TMetro2033.SetCaption(Value: String);
begin
  if Value<>FCaption then
  begin
    FCaption:=Value;
    FParent.Invalidate;
  end;
end;

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  with TMetro2033.Create(Self) do
  begin
    Caption:='Metro2033';
  end;
end;

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