Delphi ×Ô¼ºÐ´¸öTimerÍæÍæ
¼¼Êõ½»Á÷,DH½²½â.
Ã÷ÌìÈ¥×ø»ð³µ,»Ø¼Ò,½ñÌì¾ÍûÓÐÊÂ×ö,±¾À´ÔÚŪһ¸ö¿ç½ø³Ì»ñÈ¡ÆäËû³ÌÐòÀïÃæ×é¼þ,ÈçListView,ListBox,ButtonµÈµÄÐÅÏ¢,ͻȻÓиöÏë·¨×Ô¼ºÐ´¸öTimer,²»ÓÃSetTimerº¯Êý,ÎÒÃÇ×Ô¼ºÓøö¶àÏß³ÌÒ²ÕýºÃʵÏÖÕâ¸ö.·´ÕýÇ°¶Îʱ¼ä¶àÏß³ÌҲŪµÃ±È½Ï¶à,±¾À´Ïëµ¥¶À½²½²µÄ,ÏÖÔÚ¾ÍÓøöÀý×ÓÀ´ËµÃ÷°É.
д³ÉÒ»¸ö¿Ø¼þ:utTimer.pas
view source
< id="highlighter_394362_clipboard" title="copy to clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" type="application/x-shockwave-flash">
print?
001
unit utTimer;
002
003
interface
004
uses
005
Windows,SysUtils,Classes;
006
007
type
008
THuangJackyTimerThread = class;
009
THuangJackyTimer = class(TComponent)
010
private
011
FTimeInterval:Integer;
012
FOnTimerDo:TNotifyEvent;
013
FTimerThread:THuangJackyTimerThread;
014
FEnable:Boolean;
015
procedure SetEnable(bBool:Boolean);
016
procedure SetTimeInterval(aValue:Integer);
017
018
procedure StopThread;
019
procedure StartThread;
020
public
021
constructor Create(AOwner: TComponent); override;
022
destructor Destroy; override;
023
published
024
property TimeInterval:Integer read FTimeInterval write SetTimeInterval;
025
property OnTimerDo:TNotifyEvent read FOnTimerDo write FOnTimerDo;
026
property Enable:Boolean read FEnable write SetEnable;
027
end;
028
029
THuangJackyTimerThread = class(TThread)
030
private
031
&nb
Ïà¹ØÎĵµ£º
ÔÚдc++µÄ½Ó¿Úʱ¿ÉÒÔ½«Á½¸öÏ໥ÒýÓõÄÀà·ÅÔÚÁ½¸ö.hÎļþÖУ¬È»ºó½«Õâ¸ö½Ó¿Ú·Òëµ½delphiʱ£¬·ÅÔÚÁ½¸öÎļþÀï¾Í²»¿ÉÄÜÁË¡£Ö»ÄÜ·ÅÔÚͬһ¸öunitÖС£²¢ÇÒÒª½«ÕâÁ½¸öÀ඼·ÅÔÚͬһ¸ötypeÏÂÃæ½øÐж¨Ò壬µ±Ç°ÃæÒ»¸öÀàҪʹÓúóÃæÒ»¸öÀàʱ£¬ÐèÒªÔÚÇ°ÃæÒ»¸öÀàµÄÇ°Ãæ·ÅÖÃÒ»¸öÇ°ÖÃÉùÃ÷£¬²¢ÇÒÇ°ÖÃÉùÃ÷Ö»ÄÜÊÇIVariantMap = class;ÕâÖÖ¸ñʽ¶ø² ......
Delphi¶¯Ì¬Ê¼þÉîÈë·ÖÎö
2009-2-7
×÷Õß:²»µÃÏÐ
ºËÐÄÌáʾ£º±¾ÊµÑéÖ¤Ã÷ÁËÔÚÀàÖз½·¨µÄµ÷ÓÃʱºò£¬ËùÓеķ½·¨¶¼Òþº¬ÁËÒ»¸öSelf²ÎÊý£¬²¢ÇҸòÎÊý×÷Ϊ¶ÔÏó·½·¨µÄµÚÒ»¸ö²ÎÊý´«µÝ...
Ê×ÏÈ×öÒ»¸ö¿Õ´°Ì壬·ÅÈëÒ»Button¡£
ÔÚimplementationÏÂÃæÉùÃ÷Á½¸ö·½·¨ÈçÏ£º
//Íⲿ·½·¨£¬Ö»ÉùÃ÷Ò»¸ö²ÎÊý£¬´Ëʱ°´ÕÕ±ê×¼µÄ¶ÔÏóÄÚ²¿Ê¼þ·½·¨T ......
ÍøÉÏDownµÄÒ»¸öµ¥Ôª.×Ô¼º¸ÄÁËÏÂ. unit utCRC32;
interface
uses
Windows,SysUtils,Classes;
const //Crc32±í
Crc32Tab: Array[0..$FF] of LongInt =
($00000000, $77073096, $ee0e612c, $990951ba, $076dc419, $706af48f,
$e963a535, $9e6495a3, $0edb8832, $79dcb8a4, $e0d5e91e, $97d2d988,
$0 ......
ÀýÈçÒÔÏ´úÂ룺
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs;
type
TForm1 = class(TForm)
procedure one();
function two(x,y:integer):integer;
private
......
¼¼Êõ½»Á÷,DH½²½â. ¼ÇµÃºÜÔç֮ǰÎÒ¾Í˵¹ý,Êý×éºÍ½á¹¹ÌåÔÚÄÚ´æÖÐÆäʵһÑùµÄ,ËûÃǶ¼ÊÇÁ¬Ðø·Ö²¼µÄ.
ÀýÈç: TMyStruct = record
A,B,C:Integer;
end;
T3IntArray = array[0..2]of Integer;
ÕâÁ½¸ö¶¼Õ¼12×Ö½Ú,¶øÇÒTMyStruct.A¾ÍÊÇT3IntArray[0].
¶øÎÒÃÇÖªµÀÔÚ·ÃÎÊÊý×éÖÐij¸öÔªËصÄʱºò,Ö»ÊÇÔÚµ ......