if Application.MessageBox('是否保存当前单据的数据?', '提示', MB_YESNOCANCEL +
  MB_ICONQUESTION) = IDYES then
  begin
    
  end以上代码只判断了yes按钮实现的功能, 我现在想实现点yes实现代码1,点no实现代码2,点cancel实现代码3,应该怎样判断或截取,给出代码,谢谢

解决方案 »

  1.   

    Case Application.MessageBox('是否保存当前单据的数据?', '提示', MB_YESNOCANCEL +
      MB_ICONQUESTION)  of
        mrYES:    //代码1
        mrNO:     //代码2
        mrCancel: //代码3
    end;
      

  2.   

    如果用if语句的话:
    变量 := Application.MessageBox('是否保存当前单据的数据?', '提示', MB_YESNOCANCEL +
      MB_ICONQUESTION) ;
    if 变量 = x then
    else if 变量 =y then
    else
      

  3.   

    Case Application.MessageBox('是否保存当前单据的数据?', '提示', MB_YESNOCANCEL +
      MB_ICONQUESTION)  of
        IDYES:    //代码1
        IDNO:     //代码2
        IDCancel: //代码3
    end;
      
      

  4.   

    就是如下这点就可以了:Case Application.MessageBox('是否保存当前单据的数据?', '提示', MB_YESNOCANCEL +
      MB_ICONQUESTION)  of
        mrYES:    //代码1
        mrNO:     //代码2
        mrCancel: //代码3
    end;