procedure TForm1.Button1Click(Sender: TObject);
var
buttonSelected : Integer;
begin
// Show a confirmation dialog
buttonSelected := MessageDlg('Confirmation',mtError, mbOKCancel, 0);
// Show the button type selected
if buttonSelected = mrOK then ShowMessage('OK pressed');
if buttonSelected = mrCancel then ShowMessage('Cancel pressed');
end;
MessageDlg ('You have clicked outside of the button', mtWarning, [mbOK], 0);