⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.~pas

📁 模仿QQ宠物程序的Delphi程序源代码的例子
💻 ~PAS
字号:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    RzFormShape1: TRzFormShape;
    Image1: TImage;
    procedure Image1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
    i:integer;
    procedure WMNCPaint(var Msg : TWMNCPaint); message WM_NCPAINT;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Image1Click(Sender: TObject);
begin
  Timer1.Enabled:=true;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin

 if i=0 then
 begin
 // RzFormShape1.Picture:=nil;
  RzFormShape1.Picture.LoadFromFile('e:\3.bmp');
  i:=1;
 end
 else
 begin
  //RzFormShape1.Picture:=nil;
  RzFormShape1.Picture.LoadFromFile('e:\4.bmp');
  i:=0;
 end;
 self.Left:=self.Left-10;
 if self.Left<1 then
 begin
   Timer1.Enabled:=false;
  // RzFormShape1.Picture:=nil;
   RzFormShape1.Picture.LoadFromFile('e:\2.bmp');
 end;
 RzFormShape1.RecreateRegion;
end;
procedure TForm1.WMNCPaint(var Msg : TWMNCPaint);
begin
 Inherited;

end;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -