#1
  1. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12

    exit confirmation window


    this is slightly embarassing...:confused:

    All i need to do is get a message box appear on the screen when the user hits the exit button asking i they really wish to exit. I am using BCB v6.

    However, i caanot get the return value of the button that has been pressed.

    This is the code i currently have. I have tried various different versions of it but none work.

    Code:
     MessageDlg("Do you really want to exit?", mtConfirmation,
                  TMsgDlgButtons() << mbYes << mbNo,0);
    
            if(MessageDlg == mrYes)
            {
                    Close();
            }
            else
            {
                    Action = caNone;
            }
    Help appreciated,

    TIA

    :)
    -----------------------------------------------------------
    4dr14n
  2. #2
  3. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    OK, just managed to sort my problem.

    For information, the code i needed was:

    [CODE]

    if(MessageDlg("Do you really want to exit?", mtConfirmation,
    TMsgDlgButtons() << mbYes << mbNo,0) == mrYes)
    {
    Close();
    }
    else
    {
    Action = caNone;
    }
    [\CODE]

    Only on a Monday morning would i not have realised this problem!!!


    :p
    -----------------------------------------------------------
    4dr14n

IMN logo majestic logo threadwatch logo seochat tools logo