小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

delphi AfxMessageBox與MessageBox的區(qū)別

 佚名2016 2016-08-25
 

1、AfxMessageBox與MessageBox的區(qū)別:

 

AfxMessageBox是MFC庫(kù)提供的全局函數(shù),提供了多種重載形式,而MessageBox是標(biāo)準(zhǔn)的windows Api函數(shù).

估計(jì)AfxMessageBox 最終還是調(diào)用了MessageBox.

AfxMessageBox()函數(shù)在任何類里邊都可以使用,而MessageBox()函數(shù)只能在CWnd類的繼承類中使用。

另外,AfxMessageBox()函數(shù)的參數(shù)沒(méi)有MessageBox()函數(shù)的參數(shù)豐富,所以后者較前者靈活。

AfxMessageBox不能控制消息框標(biāo)題,常用于調(diào)試程序時(shí)的內(nèi)部數(shù)據(jù)輸出或警告;MessageBox比較正式,常用在要提交的應(yīng)用程序版本中,可以控制標(biāo)題內(nèi)容而不必采用含義不明的可執(zhí)行文件名為標(biāo)題。

 

2、MessageBox的使用:

 

int MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL,UINT nType =MB_OK );

參數(shù):

lpszText: 消息正文

lpszCaption:消息框標(biāo)題(默認(rèn)沒(méi)有)

nType:消息框的風(fēng)格

 

nType取值:

 

1.消息框的風(fēng)格

MB_ICONQUESTION

! MB_ICONWARNING

X MB_ICONHAND or MB_ICONSTOP

i MB_ICONINFORMATION

2.Button Array: 按鈕 消息框類型

[YES] [NO]           MB_YESNO

[YES][NO][CANCEL]    MB_YESNOCANCEL

[RETRY][CANCEL]      MB_RETRYCANCEL

[OK]                 MB_OK

[OK][CANCEL]         MB_OKCANCEL

[ABORT][RETRY][IGNORE]     MB_ABORTRETRYIGNORE

(想在彈出的對(duì)話框中顯示的按鈕,默認(rèn)為MB_OK)

 

Return Values of MessageBox: Value Meaning 返回值

 

IDABORT        Abort button was selected.

IDCANCEL       Cancel button was selected.

IDIGNORE       Ignore button was selected

IDNO           No button was selected.

IDOK           OK button was selected

IDRETRY        Retry button was selected.

IDYES          Yes button was selected

 

nType中可以組合使用, for examble:

...

int iRes = MessageBox("你看見(jiàn)消息框了嗎?","測(cè)試",MB_YESNO|MB_ICONWARNING);

if( iRes == IDYES )

MessageBox("看見(jiàn)了就好!");

 

3、MessageDlg的用法:

if MessageDlg('確定嗎?',mtInformation,[mbYES,mbNo],0)=mrYes then
begin
memo1.lines.add('添加一行字');
end;

mtInformation代表窗口類型.你把光標(biāo)按到這里按f1就知道有幾種類型了.
有如下:
mtWarning A message box containing a yellow exclamation point symbol.
mtError         A message box containing a red stop sign.
mtInformation A message box containing a blue "i".
mtConfirmation A message box containing a green question mark.
mtCustom A message box containing no bitmap. The caption of the message box is the name of the application's executable file.
 
[mbYes,mbNo]是指按鈕的樣子.還有好多種.把光標(biāo)按這里按f1就明白了.
[mbYes,mbNo,mbOK,mbCancel...]

TMsgDlgBtn Value     Corresponding return value

mbOk                       mrOk
mbCancel                mrCancel
mbYes                       mrYes
mbNo                       mrNo
mbAbort                mrAbort
mbRetry                mrRetry
mbIgnore                mrIgnore

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多