Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphiËæ»úÊäÈëÑéÖ¤Âë

ÊäÈëÑéÖ¤Âë Ò»¸öÎı¾¿ò 24×ÖÄ¸Ëæ»ú³ö4¸ö×Öĸ È»ºóÓû§
ÊäÈëËùËæ»ú³öµÄ×Öĸ ÊäÈëÕýÈ· ½øÈë½çÃæ¡£¡£´íÎóÓÖËæ»úÏ¡£¡£¡£
*/
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
lbl1: TLabel;
Edit1: TEdit;
btn1: TButton;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
function ShowRandom:string;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
var
i,j:Integer;
c:Char;
begin
lbl1.Caption:=''; //Õâ¸öÊDZêÇ©
for j:=0 to 3 do //Ëæ»úÉú³É4¸öaµ½zµÄ×Ö·û´®
begin
i:=Random(24);
c:=chr(ord('a') + i);
lbl1.Caption:=lbl1.Caption + c;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Randomize;
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
if edit1.Text=lbl1.Caption then //³É¹¦
ShowMessage('0k')
else
ShowMessage('error');
end;
function ShowRandom:string;
var
i,j:Integer;
c:Char;
begin
Result:='';
for j:=0 to 3 do //Ëæ»úÉú³É4¸öaµ½zµÄ×Ö·û´®
begin
Randomize;
i:=Random(24);
c:=chr(ord('a') + i);
Result:=Result + c;
end;
end;
end.


Ïà¹ØÎĵµ£º

DelphiÄ£Äâ¼üÅÌ¿ØÖÆCaps Lock(keybd_event)

ÒÔCaps Lock¼ü¾ÙÀý£¬ÆäËü(VK_NUMLOCK),Ààͬ£º
 
ÅжÏ״̬£º
 
·½·¨1
Level: integer;
   
Level := GetKeyState(VK_CAPITAL);
if Level = 0 then
//ûÁÁ
else
//ÁÁÁË(1)
 
·½·¨2
KeyState : TKeyBoardState;
 
GetKeyboardState(KeyState);
if KeySt ......

Delphi TObjectʵÏÖÁËÒ»¸öInstanceSize()·½·¨


unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    Button2: TButton;
    procedure Butt ......

¸ÄÔìDelphiµÄTStringHash³É±È½ÏͨÓõĹþÏ£±í

ÓÐʱºòÎÒÃÇÐèÒª¿ÉÒÔ¸ßËÙ¼ìË÷µÄÁÐ±í£¬×ÔÈ»»áÏëµ½¹þÏ£±í£¬Æ½Ê±ÎÒÃÇ¿ÉÄÜÏëµ½ÓÃIniFilesµ¥ÔªÀïµÄTHashedStringList£¬µ« THashedStringListÿ´ÎÐÂÔöÒ»¸öItemºó¶¼ÐèҪˢÐÂÒ»±é£¬Êý¾Ý¶àÁË¿ÉÄÜ»áÓеãÂý£¬¸Ð¾õ²»Ì«ºÃ£¬¶øTStringHashÔòÖ»ÄÜ´æ IntegerÐ͵Ä(ËäÈ»ÎÒÃÇ¿ÉÒ԰ѱðµÄ¶«Î÷Ç¿ÖÆ×ª³ÉÕûÐÍ´æ½øÈ¥£¬µ«¸Ð¾õ²»Ì«ºÃ)¡£TStringHashÒѾ­Ê ......

delphi È¡CPUÐòÁкŵķ½·¨


interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TDemoForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
GetButton: TBitBtn;
CloseButton: TBitBtn;
Bevel1: TBevel;
Label5: TLabel; ......

delphiÏÔʾ jpg¡¢png¡¢gif ͼƬ¼° gif ¶¯»­µÄ·½·¨

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Bu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ