Jump to content

MessageDlg returns 0 before Dialog Yes/No button is clicked


delphilearner

Recommended Posts

Hi guys, my UniGuiDialog.MessageDlg always return 0 before any dialog button is clicked, and the number will not change after clicking yes/no button in the dialog. Not sure if it is a bug..

here is my code:

procedure TMainForm.UniButton3Click(Sender: TObject);
var
int: integer;
begin
    int := MessageDlg('ha', mtConfirmation, mbYesNo);
    UniEdit1.Text:= inttostr(int);
end;

 

Link to comment
Share on other sites

Hello,

I just started delphi and unigui recently. What I am trying to do is very similar to this:

procedure TMainForm.UniButton6Click(Sender: TObject);
begin
  if MessageDlg('Dialog3', mtConfirmation, mbYesNo) = mrno then
  begin
    Abort;
  end;
end;

But since it will always turn a 0, it won't abort even the No button is clicked. That makes me confused. Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...