H
heidongzhiling
Unregistered / Unconfirmed
GUEST, unregistred user!
我将RadioButton.checked的值读入了注册表,然后我希望在开机的时候读取值赋给RadioButton
可是就是出错。我估计是消息的处理,和交叉影响求解决方法。
我的源码:
uses pop2,registry,smtp1;
{$R *.DFM}
procedure TParaForm.FormClose(Sender: TObject;
var Action: TCloseAction);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
if Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run',true) then
begin
Reg.WriteBool('收发信件',pop1.cnt.Enabled);
end;
end;
procedure TParaForm.FormCreate(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run',true);
ParaSet.ParaForm.RadioButton1.Checked:=Reg.readBool('收发信件');
end;
procedure TParaForm.RadioButton2Click(Sender: TObject);
begin
pop2.Pop1.Cnt.Enabled:=true;
//也是一个按钮
smtp1.smtp.Button1.Enabled:=true;
end;
procedure TParaForm.RadioButton1Click(Sender: TObject);
begin
pop2.Pop1.Cnt.Enabled:=false;
smtp1.smtp.Button1.Enabled:=false;
end;
end.
可是就是出错。我估计是消息的处理,和交叉影响求解决方法。
我的源码:
uses pop2,registry,smtp1;
{$R *.DFM}
procedure TParaForm.FormClose(Sender: TObject;
var Action: TCloseAction);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
if Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run',true) then
begin
Reg.WriteBool('收发信件',pop1.cnt.Enabled);
end;
end;
procedure TParaForm.FormCreate(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run',true);
ParaSet.ParaForm.RadioButton1.Checked:=Reg.readBool('收发信件');
end;
procedure TParaForm.RadioButton2Click(Sender: TObject);
begin
pop2.Pop1.Cnt.Enabled:=true;
//也是一个按钮
smtp1.smtp.Button1.Enabled:=true;
end;
procedure TParaForm.RadioButton1Click(Sender: TObject);
begin
pop2.Pop1.Cnt.Enabled:=false;
smtp1.smtp.Button1.Enabled:=false;
end;
end.