屏保自己做

因需要根据不同星期自动调用不同屏保图片,自己动手做了一个

代码如下:

//主工程文件
program scrsave;usesForms,Unit1 in 'Unit1.pas' {Form1};{$R *.res}beginApplication.Initialize;Application.Title := '横店屏保一';Application.CreateForm(TForm1, Form1);Application.Run;
end.//单元文件
unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, ExtCtrls, StdCtrls, JPEG;typeTForm1 = class(TForm)Timer1: TTimer;procedure FormDestroy(Sender: TObject);procedure FormCreate(Sender: TObject);procedure FormShow(Sender: TObject);procedure Timer1Timer(Sender: TObject);procedure LoadImage(img: TBitmap; cFile: String);procedure FormMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);procedure FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);privateprocedure FindFiles(sPath: string);procedure Detect(var Msg: TMsg; var Handled: Boolean);procedure BackClear;//清屏procedure HundredLeaf(cFile: string);  //百叶窗procedure PushDrag(cFile: string);//推拉procedure HorizonCross(cFile: string);//水平交错procedure VericalCross(cFile: string);//垂直交错procedure PutStick(cFile: string); //积木procedure CenToAll(cFile: string);//中间到四周procedure AllToCen(cFile: string);procedure LUpToRDown(cFile: string);//左上到右下procedure RDownToLUp(cFile: string);//右下到左上procedure LDownToRUp(cFile: string);//左下到右上procedure RUpToLDown(cFile: string);//右上到左下procedure MidToBoth(cFile: string);//中间到两边procedure BothToMid(cFile: string);//两边到中间procedure FlowSand(cFile: string);//流沙{ Private declarations }public{ Public declarations }end;varForm1: TForm1;FilesList: TStringList;sFilePath: string;Stop: boolean;implementation
//{$D ScreenSave 我的屏幕保护}{$R *.dfm}procedure TForm1.FormDestroy(Sender: TObject);
beginFilesList.Free;
end;procedure TForm1.FormCreate(Sender: TObject);
varweek: Integer;
beginself.Color := clBlack;Stop := False;//按星期选择相应的文件夹week := DayOfWeek(Date());case week of1,2: sFilePath := ExtractFilePath(Application.ExeName)+'Hdds\monday';3: sFilePath := ExtractFilePath(Application.ExeName)+'Hdds\tuesday';4: sFilePath := ExtractFilePath(Application.ExeName)+'Hdds\wendsday';5: sFilePath := ExtractFilePath(Application.ExeName)+'Hdds\thursday';6,7: sFilePath := ExtractFilePath(Application.ExeName)+'Hdds\friday';end;FindFiles(sFilePath);//Self.FormStyle := fsStayOnTop;
end;procedure Tform1.FindFiles(sPath: string);
function FType(cFile: String): boolean;
vark :integer;ext: string;
beginresult := false;if Length(cFile) > 2 thenbegink := pos('.',cFile);ext := UpperCase(copy(cFile,k,length(cFile)-k+1));if (ext= '.JPEG') or (ext= '.JPG') or (ext= '.BMP') thenresult := true;end;
end;
varSearchRec: TSearchRec;
beginif not Assigned(FilesList) then FilesList:= TStringList.Create;FilesList.Clear;if FindFirst(sPath+'\*.*', 0, SearchRec)=0 thenbegintryrepeatif FType(SearchRec.Name) thenbeginFilesList.Add(sPath+'\'+SearchRec.Name);end;until FindNext(SearchRec)<>0;exceptFindClose(SearchRec);raise;end;FindClose(SearchRec);end;
end;procedure TForm1.Detect(var Msg: TMsg; var Handled: Boolean);
beginif (Msg.message = wm_keydown) or (Msg.message = wm_lbuttondown) or(Msg.message = wm_rbuttondown)thenbeginstop := true;Timer1.Enabled := True;close;end;
end;procedure TForm1.FormShow(Sender: TObject);
beginWindowState := wsMaximized;Self.BringToFront;ShowCursor(False);Application.OnMessage := Detect;
end;//百叶窗效果
procedure TForm1.HundredLeaf(cFile: string);
varBitTemp1,BitTemp2,Bitmap:TBitmap;i,j,bmpheight,bmpwidth:integer;xgroup,xcount:integer;
beginBitTemp1:= TBitmap.Create;//过渡位图BitTemp2:= TBitmap.Create;Bitmap := TBitmap.Create;BackClear;tryLoadImage(BitTemp1, cFile);BitTemp2.Width := self.Width;BitTemp2.Height := self.Height;BitTemp2.Canvas.StretchDraw(ClientRect, BitTemp1);Bitmap.Width := self.Width;Bitmap.Height := self.Height;bmpheight:=Height;bmpwidth:=Width;xgroup:=10;xcount:=bmpheight div xgroup;for i:=0 to xcount dofor j:=0 to xgroup dobeginsleep(10);Bitmap.Canvas.CopyRect(Rect(0,xcount*j+i-1,bmpwidth,xcount*j+i),BitTemp2.Canvas,Rect(0,xcount*j+i-1,bmpwidth,xcount*j+i)); self.Canvas.Draw(0,0,Bitmap);Application.ProcessMessages;if Stop then Exit;end;finallyBitmap.Free;BitTemp1.Free;BitTemp2.Free;end;
end;//=========================================================
//推拉效果
//==========================================================
procedure TForm1.PushDrag(cFile: string);
varBitTemp1,BitTemp2:TBitmap;//Bitmap:TBitmap;i,bmpheight,bmpwidth:integer;
beginBackClear;  //清屏BitTemp1:= TBitmap.Create;//过渡位图BitTemp2:= TBitmap.Create;//Bitmap := TBitmap.Create;tryLoadImage(BitTemp1, cFile);BitTemp2.Width := self.Width;BitTemp2.Height := self.Height;BitTemp2.Canvas.StretchDraw(ClientRect, BitTemp1);//Bitmap.Width := self.Width;// Bitmap.Height := self.Height;bmpheight:=Height;bmpwidth:=Width;for i:=0 to bmpheight dobegin{Bitmap.Canvas.CopyRect(Rect(0,bmpheight-i,bmpwidth,bmpheight),BitTemp2.Canvas,Rect(0,0,bmpwidth,i));self.Canvas.Draw(0,0,Bitmap,); }BitBlt(Self.Canvas.Handle,0,bmpheight-i,bmpwidth,bmpheight,BitTemp2.Canvas.Handle,0,0,srcCopy);Application.ProcessMessages;if Stop then Exit;end;finally// Bitmap.Free;BitTemp1.Free;BitTemp2.Free;end;
end;//==============================================================
//水平交错
//==============================================================
procedure TForm1.HorizonCross(cFile: string);
varBitTemp1,BitTemp2,Bitmap:TBitmap;i,j,bmpheight,bmpwidth:integer;
begin//BackClear(cFile);  //清屏BitTemp1:= TBitmap.Create;//过渡位图BitTemp2:= TBitmap.Create;Bitmap := TBitmap.Create;tryLoadImage(BitTemp1, cFile);BitTemp2.Width := self.Width;BitTemp2.Height := self.Height;BitTemp2.Canvas.StretchDraw(ClientRect, BitTemp1);Bitmap.Width := self.Width;Bitmap.Height := self.Height;bmpheight:=Height;bmpwidth:=Width;i:=0;while i<=bmpwidth dobeginj:=i;while j >0 dobeginBitmap.Canvas.CopyRect(Rect(j-1,0,j,bmpheight),BitTemp2.Canvas,Rect(bmpwidth-i+j-1,0,bmpwidth-i+j,bmpheight));Bitmap.Canvas.CopyRect(Rect(bmpwidth-j-1,0,bmpwidth-j,bmpheight),BitTemp2.Canvas,Rect(i-j,0,i-j+1,bmpheight));j:=j-3;Application.ProcessMessages;if Stop then Exit;end;Application.ProcessMessages;if Stop then Exit;self.Canvas.Draw(0,0,Bitmap);inc(i,3);end;Bitmap.Canvas.CopyRect(rect(0,0,Width,Height),BitTemp2.Canvas,rect(0,0,Width,Height));self.Canvas.Draw(0,0,Bitmap);sleep(500);finallyBitmap.Free;BitTemp1.Free;BitTemp2.Free;end;
end;//=======================================================================
//垂直交错
//========================================================================
procedure TForm1.VericalCross(cFile: string);
varBitTemp1,BitTemp2,Bitmap:TBitmap;i,j,bmpheight,bmpwidth:integer;
beginBackClear;  //清屏BitTemp1:= TBitmap.Create;//过渡位图BitTemp2:= TBitmap.Create;Bitmap := TBitmap.Create;tryLoadImage(BitTemp1, cFile);BitTemp2.Width := self.Width;BitTemp2.Height := self.Height;BitTemp2.Canvas.StretchDraw(ClientRect, BitTemp1);Bitmap.Width := self.Width;Bitmap.Height := self.Height;bmpheight:=Height;bmpwidth:=Width;i:=0;while i<=bmpheight dobeginj:=i;while j >0 dobeginBitmap.Canvas.CopyRect(Rect(0,j-1,bmpwidth,j),BitTemp2.Canvas,Rect(0,bmpheight-i+j-1,bmpwidth,bmpheight-i+j));Bitmap.Canvas.CopyRect(Rect(0,bmpheight-j-1,bmpwidth,bmpheight-j),BitTemp2.Canvas,Rect(0,i-j,bmpwidth,i-j+1));j:=j-3;Application.ProcessMessages;if Stop then Exit;end;Application.ProcessMessages;if Stop then Exit;self.Canvas.Draw(0,0,Bitmap);i:=i+3;end;Bitmap.Canvas.CopyRect(rect(0,0,Width,Height),BitTemp2.Canvas,rect(0,0,Width,Height));self.Canvas.Draw(0,0,Bitmap);sleep(500);finallyBitmap.Free;BitTemp1.Free;BitTemp2.Free;end;
end;//===========================================================================
//积木效果
//===========================================================================
procedure TForm1.PutStick(cFile: string);
varBitTemp1,BitTemp2,Bitmap:TBitmap;i,j,x,y:integer;
beginBitTemp1:= TBitmap.Create;//过渡位图BitTemp2:= TBitmap.Create;Bitmap := TBitmap.Create;tryLoadImage(BitTemp1, cFile);BitTemp2.Width := self.Width;BitTemp2.Height := self.Height;BitTemp2.Canvas.StretchDraw(ClientRect, BitTemp1);Bitmap.Width := self.Width;Bitmap.Height := self.Height;self.Color := clBlack;i := 0;j := 0;for x:=0 to 20 dobeginfor y:=0 to 15 dobeginBitmap.Canvas.CopyRect(rect(i*50,j*50,(i+1)*50,(j+1)*50),BitTemp2.Canvas,rect(i*50,j*50,(i+1)*50,(j+1)*50));self.Canvas.Draw(0,0,Bitmap);i:=i+2;Application.ProcessMessages;if Stop then Exit;end;j:=j+2;i:=0;end;j:=1;i:=1;for x:=0 to 20 dobeginfor y:=0 to 15 dobeginBitmap.Canvas.CopyRect(rect(i*50,j*50,(i+1)*50,(j+1)*50),BitTemp2.Canvas,rect(i*50,j*50,(i+1)*50,(j+1)*50));self.Canvas.Draw(0,0,Bitmap);i:=i+2;Application.ProcessMessages;if Stop then Exit;end;j:=j+2;i:=1;end;i := 0;j := 0;for x:=0 to 20 dobeginfor y:=0 to 15 dobeginBitmap.Canvas.CopyRect(rect(i*50,(j+1)*50,(i+1)*50,(j+2)*50),BitTemp2.Canvas,rect(i*50,(j+1)*50,(i+1)*50,(j+2)*50));self.Canvas.Draw(0,0,Bitmap);i:=i+2;Application.ProcessMessages;if Stop then Exit;end;j:=j+2;i:=0;end;j:=1;i:=1;for x:=0 to 20 dobeginfor y:=0 to 15 dobeginBitmap.Canvas.CopyRect(rect(i*50,(j-1)*50,(i+1)*50,j*50),BitTemp2.Canvas,rect(i*50,(j-1)*50,(i+1)*50,j*50));self.Canvas.Draw(0,0,Bitmap);i:=i+2;Application.ProcessMessages;if Stop then Exit;end;j:=j+2;i:=1;end;finallyBitmap.Free;BitTemp1.Free;BitTemp2.Free;end;
end;procedure TForm1.Timer1Timer(Sender: TObject);
vari,j : Integer;
beginTimer1.Enabled := False;Randomize;i := 0;while not stop dobeginj := 1+Random(13);case j of1: HundredLeaf(FilesList.Strings[i]);2: PushDrag(FilesList.Strings[i]);//推拉3: HorizonCross(FilesList.Strings[i]);//水平交错4: VericalCross(FilesList.Strings[i]);//垂直交错5: PutStick(FilesList.Strings[i]); //积木6: CenToAll(FilesList.Strings[i]); //中心到四周7: AllToCen(FilesList.Strings[i]);8: LUpToRDown(FilesList.Strings[i]);//左上到右下9: RDownToLUp(FilesList.Strings[i]);//右下到左上10: LDownToRUp(FilesList.Strings[i]);//左下到右上11: RUpToLDown(FilesList.Strings[i]);//右上到左下12: MidToBoth(FilesList.Strings[i]);//中间到两边13: BothToMid(FilesList.Strings[i]);//两边到中间14: FlowSand(FilesList.Strings[i]);//流沙end;Sleep(2000);if stop thenbeginTimer1.Enabled := True;exit;end;inc(i);if i >= FilesList.Count then i := 0;end; //whileend;procedure TForm1.LoadImage(img: TBitmap; cFile: String);
varext: String;jpgimg: TJpegImage;beginext := ExtractFileExt(cFile);if (UpperCase(ext) = '.JPG') or (UpperCase(ext) = '.JPEG') thenbeginjpgimg := TJpegImage.Create;tryjpgimg.LoadFromFile(cFile);img.Assign(jpgimg);finallyjpgimg.Free;end;endelse img.LoadFromFile(cFile);
end;procedure TForm1.BackClear;//清黑屏
conststep = 100;
varBitTemp, Bitmap : TBitmap;i : integer;
begin
// self.color := clBlack;
// repaint;BitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;LoadImage(BitTemp, ExtractFilePath(Application.ExeName) + 'Hdds\Monday\Back.bmp');//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;//Bitmap.Canvas.Brush.Color := clBlack;Bitmap.Canvas.StretchDraw(ClientRect, BitTemp);for i := 1 to step doBitBlt(self.Canvas.Handle,0,step-i,Width,Height,Bitmap.Canvas.Handle,0,0,blackness);Bitmap.Free;        //释放位图BitTemp.Free;
end;procedure TForm1.CenToAll(cFile: string);//中间到四周
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;X0,Y0:integer;i,MidX,MidY:integer;RatioX,RatioY:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);x0:=width div 2;y0:=height div 2;ratiox:=Bitmap.width/step; //step每加1,图片变化的宽度ratioy:=Bitmap.height/step;for i:=0 to step dobeginmidx:=round(ratiox*i*0.5);midy:=round(ratioy*i*0.5);bitblt(self.canvas.handle,x0-midx,y0-midy,round(ratiox*i),round(ratioy*i),bitmap.canvas.handle,x0-midx,y0-midy,srccopy);//循环拷贝一定区域的图象显示,区域不断变化实现特效显示Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;  //释放位图BitTemp.Free;end;
end;procedure TForm1.AllToCen(cFile: string);//四周到中间
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i :integer;RatioX,RatioY:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);ratiox:=width/step;ratioy:=height/step;for i:= 0 to step dobegin  //由于bitblt每次只能拷贝一个矩形,故要实现//从四周到中间的渐变显示特效,需要每次拷贝周边的//四个矩形,组成一个矩形框,bitblt(self.canvas.handle,0,0,round(ratiox*i*0.5),height,bitmap.canvas.handle,0,0,srccopy);//拷贝左边的矩形bitblt(self.canvas.handle,0,0,width,round(ratioy*i*0.5),bitmap.canvas.handle,0,0,srccopy);//拷贝上方的矩形bitblt(self.canvas.handle,width-round(ratiox*i*0.5),0,width,height,bitmap.canvas.handle,width-round(ratiox*i*0.5),0,srccopy);//拷贝右边的矩形bitblt(self.canvas.handle,0,height-round(ratioy*i*0.5),width,height,bitmap.canvas.handle,0,height-round(ratioy*i*0.5),srccopy);//拷贝下面的矩形Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.LUpToRDown(cFile: string);//左上到右下
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i:integer;RatioX,RatioY:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);ratiox:=width/step;ratioy:=height/step;for i:= 0 to step dobeginbitblt(self.canvas.handle,0,0,round(ratiox*i),round(ratioy*i),bitmap.canvas.handle,0,0,srccopy);//拷贝左上角的一个矩形,要求右下角的坐标//按(round(ratiox*i),round(ratioy*i))变化,//注意,由于宽和高不等,所以它们的变化幅度//也应该有所不同。Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.RDownToLUp(cFile: string);//右下到左上
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i:integer;RatioX,RatioY:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);ratiox:=width/step;ratioy:=height/step;for i:= 0 to step dobeginbitblt(self.canvas.handle,width-round(ratiox*i),height-round(ratioy*i),width,height,bitmap.canvas.handle,width-round(ratiox*i),height-round(ratioy*i),srccopy);Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.LDownToRUp(cFile: string);//左下到右上
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i:integer;RatioX,RatioY:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);ratiox:=width/step;ratioy:=height/step;for i:= 0 to step dobeginbitblt(self.canvas.handle,0,height-round(ratioy*i),round(ratiox*i),height,bitmap.canvas.handle,0,height-round(ratioy*i),srccopy);Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.RUpToLDown(cFile: string);//右上到左下
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i:integer;RatioX,RatioY:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);ratiox:=width/step;ratioy:=height/step;for i:= 0 to step dobeginbitblt(self.canvas.handle,width-round(ratiox*i),0,width,round(ratioy*i),bitmap.canvas.handle,width-round(ratiox*i),0,srccopy);Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.MidToBoth(cFile: string);//中间到两边
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i:integer;RatioX:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);RatioX:=width/step;for i:= 0 to step dobegin//注意此时左上角的x坐标朝左变化,而右下角的x坐标朝右变化bitblt(self.canvas.handle,round(width/2)-round(ratiox*i*0.5),0,round(ratiox*i),height,bitmap.canvas.handle,round(width/2)-round(ratiox*i*0.5),0,srccopy);Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.BothToMid(cFile: string);//两边到中间
constStep=1600;  //循环的次数,用以调整图象变动的快慢
varBitmap, BitTemp:TBitmap;i:integer;RatioX:real;
beginBitTemp := TBitmap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp, cFile);//载入图片Bitmap.Width := self.Width;Bitmap.Height := self.Height;Bitmap.Canvas.StretchDraw(self.ClientRect, BitTemp);ratiox:=width/step;for i:= 0 to step dobegin//实际是从四周到中心变化的简化。bitblt(self.canvas.handle,0,0,round(ratiox*i*0.5),height,bitmap.canvas.handle,0,0,srccopy);bitblt(self.canvas.handle,width-round(ratiox*i*0.5),0,width,height,bitmap.canvas.handle,width-round(ratiox*i*0.5),0,srccopy);Application.ProcessMessages;if Stop then Exit;end;finallybitmap.free;     //释放位图BitTemp.Free;end;
end;procedure TForm1.FlowSand(cFile: string);//流沙
varBitmap, BitTemp1, BitTemp2:TBitmap;i,j:integer;
beginBitTemp1 := TBitmap.Create;BitTemp2 := TBitMap.Create;Bitmap:=TBitmap.Create;tryLoadImage(BitTemp1, cFile);//载入图片BitTemp2.Width := self.Width;BitTemp2.Height := self.Height;BitTemp2.Canvas.StretchDraw(self.ClientRect, BitTemp1);BitMap.width := Self.width;BitMap.height := Self.height;i:=BitMap.Height;for j:= 1 to i dobeginBitMap.Canvas.CopyRect(Rect(0,j-1,BitMap.Width,j),BitTemp2.Canvas,Rect(0,i-1,BitMap.Width,i));Self.Canvas.Draw(0,j-1,BitMap);Application.ProcessMessages;if Stop then Exit;end;for i:=BitMap.Height downto 1 dobeginBitMap.Canvas.CopyRect(Rect(0,i-1,BitMap.Width,i),BitTemp2.Canvas,Rect(0,i-1,BitMap.Width,i));Self.Canvas.Draw(0,i-1,BitMap);Application.ProcessMessages;if Stop then Exit;end;finallyBitmap.free;     //释放位图BitTemp1.free;BitTemp2.Free;end;
end;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
beginclose;
end;procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
beginclose;
end;end.//窗体文件
object Form1: TForm1Left = 237Top = 206Align = alCustomBorderStyle = bsNoneCaption = 'Form1'ClientHeight = 487ClientWidth = 613Color = clBtnFaceFont.Charset = DEFAULT_CHARSETFont.Color = clWindowTextFont.Height = -11Font.Name = 'Tahoma'Font.Style = []OldCreateOrder = FalsePosition = poScreenCenterOnCreate = FormCreateOnDestroy = FormDestroyOnKeyDown = FormKeyDownOnMouseDown = FormMouseDownOnShow = FormShowPixelsPerInch = 96TextHeight = 13object Timer1: TTimerInterval = 2000OnTimer = Timer1TimerLeft = 15Top = 26end
end

转载于:https://www.cnblogs.com/boltwolf/archive/2011/06/07/2074443.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/298316.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SpringMVC异常处理流程

2019独角兽企业重金招聘Python工程师标准>>> Controller中的方法执行出现异常ex.ex在DispatchServlet中被捕获,交给默认的ExceptionHandlerExceptionResolver进行处理.ExceptionHandlerExceptionResolver先在Controller中找标有ExceptionHandler的方法.没有找到. go…

python if main_Python:if __name__ == '__main__'

简介&#xff1a;__name__是当前模块名&#xff0c;当模块被直接运行时模块名为_main_&#xff0c;也就是当前的模块&#xff0c;当模块被导入时&#xff0c;模块名就不是__main__&#xff0c;即代码将不会执行。关于代码if __name__ __main__: 下面举几个例子解释下:先编写一…

mysql select 反选_JQuery实现全选、全不选和反选功能

Insert title here学员信息查询管理系统条件&#xff1a;全选 反选学号姓名性别年龄成绩班级$(selectStu())functionselectStu() {$.ajax("StuList",{type:"post",data:{"method":"finList"},success:function(data){//循环遍历$.each…

真希望永远用不到这些代码

<style> html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale1);} </style> 汶川大地震的时候用过一次&#xff0c;如今又要用了……

为什么盯一个字看久了,反而感觉不认识了?

全世界只有3.14 % 的人关注了爆炸吧知识你肯定有过这样一种体验——长时间盯着某个字看&#xff0c;或者重复写一个字&#xff0c;就会觉得这个字越写越不认识想想你被老师罚抄作业的时候……盯着这张图看1分钟▼你是不是就不认识“哈”了神经活动被你“玩累”了盯着一个字看久…

自建PicGo图床

介绍图床工具&#xff0c;就是自动把本地图片转成连接的一款工具&#xff0c;网络上有很多图床工具&#xff0c;PicGo就是一款比较优秀的图床工具&#xff0c;可以支持微博&#xff0c;七牛云&#xff0c;腾讯云COS&#xff0c;又拍云&#xff0c;GitHub&#xff0c;阿里云OSS&…

3D 架设场景

指定视口glViewport指定投影变换glMatrixMode(GL_PROJECTION);glLoadIdentity();gluPerspective(30, 1, 0.1, 50);指定视图变换glMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(0.0f, 0.0f, 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);gluPerspective(GLdouble fovy,G…

【心情】今天买了ZÈRTZ!

转载于:https://www.cnblogs.com/boringlamb/archive/2010/04/27/1721772.html

promise 浏览器实现的源码_【大前端01-01】函数式编程与JS异步编程、手写Promise...

【简答题】一、谈谈你是如何理解JS异步编程的&#xff0c;EventLoop、消息队列都是做什么的&#xff0c;什么是宏任务、什么是微任务&#xff1f;如何理解JS异步编程众所周知JavaScript语言执行环境是“单线程”(单线程&#xff0c;就是指一次只能完成一件任务&#xff0c;如果…

python姓名输出语句_Python最基本的输入输出详解

输出用print加上字符串&#xff0c;就可以向屏幕上输出指定的文字。比如输出hello, world&#xff0c;用代码实现如下&#xff1a;>>> print hello, worldprint语句也可以跟上多个字符串&#xff0c;用逗号“,”隔开&#xff0c;就可以连成一串输出&#xff1a;>&g…

当代人的恋爱步骤

1 耳朵连线了&#xff1f;2 有时候我们更需要做一个稳重的吃货3 你大爷果然是你大爷… 4 我竟然下意识的吹了一口5 这也太孤独了6 当代人的恋爱步骤7 据说这张图上有10个人&#xff0c;你能找到几个&#xff1f;你点的每个赞&#xff0c;我都认真当成了喜欢

使用EF Core操作层次结构数据

前言以前我们存储层次结构常用IdParentId的方式&#xff0c;例如&#xff1a;IdParentIdName1null总公司21分公司131分公司242部门A54小组X64小组Y这种方式查询效率不高&#xff0c;比如查询分公司1下的所有小组&#xff0c;必须使用递归。针对这个问题&#xff0c;如果你是使用…

sql2005数据导入出错问题

最近在把一个大的文本文件中的数据导入到sql2005中时&#xff0c;出现错误。<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" />相同文件导入sql2000则不会出现错误。网络上一查&#xff0c;也有部分人碰到这个问题。解决的办法200…

仿UC菜单的实现

http://blog.csdn.net/hellogv/archive/2011/01/28/6168439.aspx &#xff08;另&#xff09;http://www.cnblogs.com/lichien/archive/2010/09/07/1820453.html 先来看看本文程序运行的效果&#xff1a; TabMenu 本身就是一个PopupWindow&#xff0c;PopupWindow上面放了两个G…

java将字符串转成json_Java 字符串(String)格式转json格式

json是前后端传输数据的一种文本格式&#xff0c;json其实就是字符串&#xff0c;因为前后端传输数据时&#xff0c;只能传输字符串&#xff0c;我们又想传一些对象或者列表信息&#xff0c;这都是很常见的应用场景。所以&#xff0c;我们需要在java代码中&#xff0c;把java中…

选了combobox里的选项后没激发change事件_stata 事件分析法

前言&#xff1a;因为一些原因&#xff0c;国庆节期间学的。学习过程很酸爽&#xff0c;自己并没有很多统计学及其相关软件的经验&#xff0c;网上相关资料也不是很多。我在微信公众号、知网、经管之家、B站、百度文库等很多平台找了各式的资料来学&#xff08;花了70大洋去买代…

RHCE 学习笔记(24) - LVM 逻辑卷

这一节学习了如何创建LVM&#xff0c;LVM的快照以及RAID的相关配置。对于普通的分区&#xff0c;扩展度不高&#xff0c;一旦分区格式化完成&#xff0c;很难灵活的再增加或者减少分区大小。为了解决这个问题&#xff0c;可以使用LVM&#xff08;逻辑卷&#xff09;。基本过程是…

13个圆可以画什么?数学与艺术完美邂逅!原来数学也可以这么美

全世界只有3.14 % 的人关注了爆炸吧知识你知道吗&#xff1f;Twitter logo 原来是13个圆画出来的&#xff0c;果然设计师们都是牛逼的存在&#xff01;受到 Twitter logo 设计方式的启发&#xff0c;加拿大艺术家多洛塔潘科夫斯卡决定尝试挑战自我&#xff1a;利用同样的方式&a…

什么时候使用路由再分配?

什么时候使用路由再分配?<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" />路由再分配通常在那些负责从一个自治系统学习路由&#xff0c;然后向另一个自治系统广播的路由器上进行配置。如果你在使用I G R P或E I G R P&#xff…

温故知新,.Net Core遇见WinForms客户端窗体框架,在DotNet Core大一统基础上老树发芽...

什么是WinFormhttps://docs.microsoft.com/zh-cn/dotnet/desktop/winformsWindows窗体(Windows Form)&#xff0c;简称WinForms&#xff0c;是一个可创建适用于Windows的丰富桌面客户端应用的UI框架。Windows窗体开发平台支持广泛的应用开发功能&#xff0c;包括控件、图形、数…