Messagebox.Show()常用參數的討論

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 對話框_終極版
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("  1  個參數 "
                );
        }

                                      

 

 

 

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 2 個參數。。 ",
                                 "亮仔提示"
                                 );
        }

                                      


 

 


 

        private void button3_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 3 個參數。。。 ",
                                " 亮仔提示",
                                MessageBoxButtons.YesNoCancel
                                );
        } 

                                      

 

 

 


        private void button4_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 4 個參數。。。  ",
                                " 亮仔提示",
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning
                                );
        }

                                      

 

 

 

 

 

        private void button5_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 5 個參數。。 。  ",
                                " 亮仔提示",
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning,
                                MessageBoxDefaultButton.Button2
                                );
        }

                                      

 

 

 

 

 

        private void button6_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 6 個參數。。。  ",
                                " 亮仔提示",
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning,
                                MessageBoxDefaultButton.Button2,
                                MessageBoxOptions.RtlReading      //ServiceNotification//.RightAlign   // 標題向右對齊。
                                );

        }

                                      

 

 

 

 


        private void button7_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 7 個參數。。幫助菜單不可用。。。。。  ",
                                " 亮仔提示",
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning,
                                MessageBoxDefaultButton.Button2,
                                MessageBoxOptions.RightAlign,
                                true   // 標題向右對齊。。。。。
                                );

        }

                                      


 

 

 

 

 

        private void button8_Click(object sender, EventArgs e)
        {
            MessageBox.Show(" 7 個參數。幫助菜單    可用。   ",
                                " 亮仔提示",
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning,
                                MessageBoxDefaultButton.Button2,
                               MessageBoxOptions.RightAlign  ,   // 要使用默認風格,此處參數可設爲 0    
                                @"C:\Documents and Settings\Administrator\桌面\新建文本文檔.txt"
                                );
        }

                                      


    }
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章