[新手问题]调用问题。 ( 积分: 30 )

  • 主题发起人 主题发起人 a12011805
  • 开始时间 开始时间
A

a12011805

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if (Sender = RadioButton1) then
Form1.Color:=clBlack
else
if (Sender = RadioButton2) then
Form1.Color:= clMaroon;
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
begin
Form1.RadioButton1Click(Sender: TObject);
end;

请问下RadioButton2Click怎样调用RadioButton1Click1的事件。
 
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
RadioButton1Click(Sender);
end;
 
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if (Sender = RadioButton1) then
Form1.Color:=clBlack
else
if (Sender = RadioButton2) then
Form1.Color:= clMaroon;
end;

RadioButton1和RadioButton2的OnClick事件都是赋为RadioButton1Click
 
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if (Sender = RadioButton1) then
Form1.Color:=clBlack
else
if (Sender = RadioButton2) then
Form1.Color:= clMaroon;
end;

RadioButton1和RadioButton2的OnClick事件都是赋为RadioButton1Click
 
谢谢各位。
 
后退
顶部