close

MessageBox 類別 Show 方法的語法為:



數值變數名稱 = MessageBox.Show(提示訊息 [,標題] [,按鈕] [,圖示] [,預設按鈕] [,選項])



按鈕的列舉常數名稱及其意義為:


























列舉常數名稱



顯示按鈕



MessageBoxButtons.OK



「確定」按鈕



MessageBoxButtons.OKCancel



「確定」、「取消」按鈕



MessageBoxButtons.AbortRetryIgnore



「中止」、「重試」、「略過」按鈕



MessageBoxButtons.YesNoCancel



「是」、「否」、「取消」按鈕



MessageBoxButtons.YesNo



「是」、「否」按鈕



MessageBoxButtons.RetryCancel



「重試」、「取消」按鈕



圖示的列舉常數名稱及其意義為:



































列舉常數名稱



顯示按鈕



MessageBoxIcon.Asterisk



 「i」圖示



MessageBoxIcon.Error



 「X」圖示



MessageBoxIcon.Exclamation



 「!」圖示



MessageBoxIcon.Hand



 「X」圖示



MessageBoxIcon.Information



 「i」圖示



MessageBoxIcon.None



無圖示



MessageBoxIcon.Question



 「?」圖示



MessageBoxIcon.Stop



 「X」圖示



MessageBoxIcon.Warning



 「!」圖示



預設按鈕的列舉常數名稱及其意義為:

















列舉常數名稱



顯示按鈕



MessageBoxDefaultButton.Button1



以第一個按鈕為預設按鈕



MessageBoxDefaultButton.Button2



以第二個按鈕為預設按鈕



MessageBoxDefaultButton.Button3



以第三個按鈕為預設按鈕



選項的列舉常數名稱及其意義為:




















列舉常數名稱



顯示按鈕



MessageBoxOptions.DefaultDeskTopOnly



訊息方塊僅顯示於預設旳桌面。



MessageBoxOptions.RightAlign



標題文字靠右對齊。



MessageBoxOptions.RtlReading



訊息由右向左顯示。



MessageBoxOptions.ServiceNotification



訊息方塊僅顯示於作用旳桌面。



傳回值的列舉常數名稱及其意義為:





























列舉常數名稱



顯示按鈕



DialogResult.OK



按「確定」鈕



DialogResult.Cancel



按「取消」鈕



DialogResult.Abort



按「中止」鈕



DialogResult.Retry



按「重試」鈕



DialogResult.Ignore



按「略過」鈕



DialogResult.Yes



按「是」鈕



DialogResult.No



按「否」鈕



arrow
arrow
    全站熱搜
    創作者介紹
    創作者 tsjeng 的頭像
    tsjeng

    電腦心得及科學隨筆

    tsjeng 發表在 痞客邦 留言(0) 人氣()