0
การแสดงผลด้วย MessageBox
Posted by kru.fern
on
06:30
การแสดงผลด้วย MessageBox
MessageBox เป็นการแสดงผลในรูปแบบกล่องข้อความ
มีรูปแบบดังนี้
MessageBox.Show("Message", "Title", Button, Icon, DefaultButton);
โดย Message คือ ข้อความที่ปรากฏในบนหน้าต่าง MessageBox
Title คือ ข้อความที่ปรากฏบนแถบชื่อเรื่อง (Title Bar)
Button คือ ปุ่มที่ให้ผู้ใช้เลือก หลังอ่านข้อความแล้ว
Icon คือ สัญรูปที่เป็นภาพประกอบข้อความ
DefaultButton คือ การกำหนดตำแหน่งปุ่มเริ่มต้น
ปุ่มที่แสดงผล
ปุ่มที่แสดงผล
การเรียกใช้งาน
|
ปุ่มที่ปรากฏ
| ||
MessageBoxButtons.AbortRetryIgnore
|
Abort
|
Retry
|
Ignore
|
MessageBoxButton.OK
|
OK
| ||
MessageBoxButton.OKCancel
|
OK
|
Cancel
| |
MessageBoxButton.RetryCancel
|
Retry
|
Cancel
| |
MessageBoxButton.YesNo
|
Yes
|
No
| |
MessageBoxButton.YesNoCancel
|
Yes
|
No
|
Cancel
|
สัญรูปที่แสดงผล
การเรียกใช้งาน
|
สัญรูปที่ปรากฏ
|
MessageBoxIcon.Asterisk MessageBoxIcon.Information
| |
MessageBoxIcon.Error
MessageBoxIcon.Hand
MessageBoxIcon.Stop
| |
MessageBoxIcon.Exclamation MessageBoxIcon.Warning
| |
MessageBoxIcon.Question
| |
MessageBoxIcon.None
|
ไม่แสดงสัญรูป
|
แสดงความคิดเห็น