max-hb
asked on
messagedlg question
Hi there!
Something's wrong with the result of the messagedlg() function?
messagedlg('Text',mtConfir mation,[mb Yes,mbNo], 0)
gives me an integer result of 3 when pressing "Yes" in the dialog at runtime.
This should correspond to the constat "mrYes", but this has an integer value of 6 so
if (messagedlg('text',mtconfi rmation,[m byes,mbno, 0)=mryes)
then // Yes clicked
does not work properly.
Any ideas?
Something's wrong with the result of the messagedlg() function?
messagedlg('Text',mtConfir
gives me an integer result of 3 when pressing "Yes" in the dialog at runtime.
This should correspond to the constat "mrYes", but this has an integer value of 6 so
if (messagedlg('text',mtconfi
then // Yes clicked
does not work properly.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In my source files: (Delphi 3)
In Controls.pas
mrYes = idYes;
and in Windows.pas
IDYES = 6;
Which might explain why you get a 6. Which version are you using?
John
In Controls.pas
mrYes = idYes;
and in Windows.pas
IDYES = 6;
Which might explain why you get a 6. Which version are you using?
John
ASKER
Yes, that's it!
Never do something like
uses controls,qdialogs;
It results in the problem I stated above.
Never do something like
uses controls,qdialogs;
It results in the problem I stated above.
ASKER
Const
mrNone = 0;
mrOk = mrNone + 1;
mrCancel = mrOk + 1;
mrYes = mrCancel + 1;
... but still inttostr(mrYes)="6" ... strange