The documentation says:
MessageDlg returns the value of the button the user selected. The following table lists the TMsgDlgBtn values for each type of button that can appear in the message box, and the corresponding value that is returned if the user selects that button:
TMsgDlgBtn Value Corresponding return value mbOK mrOk mbCancel mrCancel mbYes mrYes mbNo mrNo mbAbort mrAbort mbRetry mrRetry mbIgnore mrIgnore mbAll mrAll mbNoToAll mrNoToAll mbYesToAll mrYesToAll mbClose mrClose
So you need to test for mrNo
.
I do recommend that you learn where to find documentation to make your life easier.