Recent

Author Topic: [SOLVED]Any help (if statement)  (Read 2616 times)

codeman

  • Jr. Member
  • **
  • Posts: 78
[SOLVED]Any help (if statement)
« on: April 04, 2012, 02:14:07 pm »
Hello this is my first topic xD

BTW my problem is : when the msgdlg appears and i click "yes" i want to being execute some code in the if statement.
What i have to write in the ( ) ?
Thanks in advance!

Code: [Select]
messagedlg('Windows Shutdown','Shutdown Now ?',mtConfirmation,[mbYes,mbNo],0);
if(....) then
begin
      .....     
end;
« Last Edit: April 04, 2012, 02:58:00 pm by codeman »
Lazarus v2.02 Win10

sfeinst

  • Full Member
  • ***
  • Posts: 237
Re: Any help (if statement)
« Reply #1 on: April 04, 2012, 02:43:49 pm »
The wiki has some good examples for the dialogs.  It is at:
http://wiki.lazarus.freepascal.org/Dialog_Examples

But as to your question, you want to do something like:
if MessageDlg('Question', 'Do you wish to Execute?', mtConfirmation, [mbYes, mbNo, mbIgnore],0) = mrYes then

codeman

  • Jr. Member
  • **
  • Posts: 78
Re: Any help (if statement)
« Reply #2 on: April 04, 2012, 02:52:42 pm »
Thnks mate   :) 
Lazarus v2.02 Win10

 

TinyPortal © 2005-2018