如何使用YES、NO提示框?

解决方案 »

  1.   

    MessageBox(NULL,_T("Content"),_T("Caption"),MB_YESNO);
      

  2.   

    MFC 的话可以用int AfxMessageBox(
       LPCTSTR lpszText,
       UINT nType = MB_OK,
       UINT nIDHelp = 0 
    );int AFXAPI AfxMessageBox(
       UINT nIDPrompt,
       UINT nType = MB_OK,
       UINT nIDHelp = (UINT) -1 
    );int CWnd::MessageBox(
       LPCTSTR lpszText,
       LPCTSTR lpszCaption = NULL,
       UINT nType = MB_OK 
    );把 nType 的位置设为 MB_YESNO 即可
      

  3.   

    int nRes = MessageBox(NULL,_T("Content"),_T("Caption"),MB_YESNO);
    if(nRes == IDYES)
    {
    ...
    }
    if(nRes == IDNO)
    {
    ...
    }