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

Код:
type
  TForm2 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
    constructor Create(TickCount: Integer); reintroduce; overload;
    constructor Create(AOwner: TComponent; TickCount: Integer); reintroduce; overload;
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

constructor TForm2.Create(TickCount: Integer);
begin
  inherited Create(Application);
  Caption:=IntToStr(TickCount);
end;

constructor TForm2.Create(AOwner: TComponent; TickCount: Integer);
begin
  inherited Create(AOwner);
  Caption:=IntToStr(TickCount);
end;

использование:

Код:
  if not Assigned(Form2) then Form2:=TForm2.Create(GetTickCount);
  Form2.Show;

либо:

Код:
  if not Assigned(Form2) then Form2:=TForm2.Create(Self, GetTickCount);
  Form2.Show;

см. в справке reintroduce и overload (в случае 2-х конструкторов)
__________________
Пишу программы за еду.
__________________
Ответить с цитированием