Показать сообщение отдельно
  #7  
Старый 05.10.2010, 10:55
Аватар для 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, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key=#27 then Tag:=1;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  while Tag=0 do
  begin
    Label1.Caption:=IntToStr(Label1.Tag);
    Label1.Tag:=Label1.Tag+1;
    Application.ProcessMessages;
  end;
  Close;
end;

end.
http://data.cod.ru/70222
__________________
Пишу программы за еду.
__________________
Ответить с цитированием