function TForm1.LeftOrRight: String;
begin
case Application.MessageBox('先左还是先右,左选是,右选否,取消再考虑一下!',PChar(Caption),MB_YESNOCANCEL or MB_ICONINFORMATION) of
IDYes : Result:='还是先左吧!';
IDNo : Result:='还是先右吧!' ;
else
Result:=LeftOrRight;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('你终于决定了:'+LeftOrRight);
end;