如题,如何在DEPHI中弹出显示确认,取消按钮的窗口,并获取点击的是确定按钮?

解决方案 »

  1.   

    //弹出确认,取消
    application.MessageBox('内容','标题',mb_okcancel);
    //获取点击的是确定按钮
    if (application.MessageBox('内容','标题',mb_okcancel)=idok) then   
      

  2.   

    if MessageBox(Handle, '确认要退出程序吗?', '确认', MB_yesNo)=id_Yes then
        Application.Terminate;
      

  3.   

    if MessageBox(Handle, '请在此输入对话框内容', '请在此输入对话框标题', MB_ICONQUESTION or MB_OKCANCEL) = IDOK then
    showmessage('OK') else showmessage('Cancel');
      

  4.   

    if MessageBox(Handle, '确实要退出系统吗?', '退出系统', MB_ICONQUESTION or MB_OKCANCEL) = IDOK then
        Application.Terminate;