AnimF.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit AnimF;
- interface
- uses
- SysUtils, Windows, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Anim;
- type
- TFormAnimals = class(TForm)
- LabelVoice: TLabel;
- BtnVoice: TButton;
- RbtnAnimal: TRadioButton;
- RbtnDog: TRadioButton;
- procedure FormCreate(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- procedure BtnVoiceClick(Sender: TObject);
- procedure RbtnAnimalClick(Sender: TObject);
- procedure RbtnDogClick(Sender: TObject);
- private
- MyAnimal: TAnimal;
- end;
- var
- FormAnimals: TFormAnimals;
- implementation
- {$R *.DFM}
- procedure TFormAnimals.FormCreate(Sender: TObject);
- begin
- MyAnimal := TAnimal.Create;
- end;
- procedure TFormAnimals.FormDestroy(Sender: TObject);
- begin
- MyAnimal.Free;
- end;
- procedure TFormAnimals.BtnVoiceClick(Sender: TObject);
- begin
- LabelVoice.Caption := MyAnimal.Voice;
- end;
- procedure TFormAnimals.RbtnAnimalClick(Sender: TObject);
- begin
- MyAnimal.Free;
- MyAnimal := TAnimal.Create;
- end;
- procedure TFormAnimals.RbtnDogClick(Sender: TObject);
- begin
- MyAnimal.Free;
- MyAnimal := TDog.Create;
- end;
- end.