Help!!!哪里错了?(30分)

  • 主题发起人 thebluehouse
  • 开始时间
T

thebluehouse

Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls,registry;

type
TForm1 = class(TForm)
TrackBar1: TTrackBar;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
Var
S:string;
A:integer;
reg:tregistry;
begin
reg:=tregistry.create;
reg.RootKey:=HKEY_CURRENT_USER;
if reg.OpenKey('controlpanel/desktop',false)then
begin
S:=reg.Readstring('menushowdelay');
A:=StrToInt(S);
trackbar1.Position:=A;
Reg.Free;
end;
end;

end.
 
把Reg.Free放到if 语句的外面
then前面要空一格!
 
老兄:你的controlpanel忘记空格了!!!
改为“control panel”立马就好!
 
接受答案了.
 
顶部