天行健,君子以自强不息~ 地势坤,君子以厚德载物~
9 Apr
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XPMan, mmSystem; //mmSystem用于播放声音
type
TForm1 = class(TForm)
Button1: TButton;
XPManifest1: TXPManifest;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{$R SOUND.RES} //编译好的声音资源,就是抖动的时候的那个声音
procedure TForm1.Button1Click(Sender: TObject);
var I: integer;
begin
PlaySound('sound', 0, SND_RESOURCE or SND_ASYNC);
for I := 0 to 4 do begin
Self.Refresh;//窗体刷新
Self.Top := Self.Top - 4; Sleep(50);
Self.Left := Self.Left - 4; Sleep(50);
Self.Top := Self.Top + 4; Sleep(50);
Self.Left := Self.Left + 4; Sleep(50);
end;
end;
end.
Leave a reply
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。(支持有建树的评论,谢绝灌水。)