常见的消息按钮映射


                                  消息*返回值*总结

int nChoice=AfxMessageBox("Overwrite existing file?",MB_YESNOCANCEL|MB_ICONQUESTION);

if(nChoice==IDYES){ //Overwrite file }

消息类型                             包含在对话框中的按钮

MB_ABORTRETRYIGNORE   Abort,Retry,and Ignore

MB_OK                             OK

MB_OKCANCEL                 OK and Cancel

MB_RETRYCANCEL            Retry and Cancel

MB_YESNO                       Yes and NO

MB_YESNOCANCEL           Yes,NO,and Cancle

 

消息框的返回值说明了用户选择了那一个按钮。表列出了用户可能的选择和返回值。

 

返回值                             选中的按钮

IDABORT                        Abort

IDCANCEL                      Cancel

IDIGNORE                      Ignore

IDNO                             No

IDOK                             OK

IDRETRY                       Retry

IDYES                           Yes  

posted @ 2012-08-06 12:25  Alan Perlis  阅读(244)  评论(0编辑  收藏  举报