procedure TForm1.Button1Click(Sender: TObject);
begin
if option1.Checked=true then
begin
  application.MessageBox(pchar('a'),'title',68);
end
else
begin
  application.MessageBox(pchar('b'),'title',68);
end
end;

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject); 
    begin 
    if option1.Checked=true then 
    begin 
      application.MessageBox(PAnsiChar(String('a')),'title',68); 
    end 
    else 
    begin 
      application.MessageBox(PAnsiChar(String('b')),'title',68); 
    end 
    end;orprocedure TForm1.Button1Click(Sender: TObject); 
    var
      s:string;
    begin 
    if option1.Checked=true then 
      s:='a'
    else 
      s:='b';application.MessageBox(PAnsiChar(s),'title',68); 
    end;
      

  2.   

    为什么很多人喜欢
    if option1.Checked=true then
    这样写,直接if option1.Checked then不就是了.感觉加个很别扭.