随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Button1: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses Unit2; {本例还包含另一个窗体 Form2}


//标题显示当前窗体的类名
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Text := Screen.ActiveForm.ClassName;
end;

//激活另一个窗体一试
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.Show;
end;

end.

posted on 2008-01-22 16:50  万一  阅读(...)  评论(...编辑  收藏