Problem with MessageDLG and Close Button. lazarus / 31-LCL ---------------------------------------------------------------------- Jvan · 2021-05-21 22:42 I have a MessageDLG having two buttons, Yes and No. But when I click the Close button is like I clicked the Yes button. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if (MessageDLG('My title', '¿My question?',        mtConfirmation, [mbYes, mbNo], 0) = mrNo) then Exit; ---------------------------------------------------------------------- dseligo · 2021-05-21 23:22 Do it like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if (MessageDLG('My title', '¿My question?',        mtConfirmation, [mbYes, mbNo], 0) <>mrYes) then Exit; ---------------------------------------------------------------------- Jvan · 2021-05-22 02:51 Thanks. ---------------------------------------------------------------------- Bart · 2021-05-22 20:54 Which OS? Which WidgetSet? Which Lazarus? This piece of code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i messagedlg('Title','Message',mtInformation,[mbYes,mbNo],0);for me only gives 3 possible result values: mrNo if I click "No" mrYes if I click "Yes" mrCancel if I press Escape or close the dialog using the X border icon. This is how it was designed to work, if it does not, then something is wrong. Bart