我是靠谱客的博主 壮观唇彩,最近开发中收集的这篇文章主要介绍MessageBox.Show()的使用,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

下面是我写的C#中MessageBox.Show()的使用,完全是自己总结,学习。有问题欢迎大家批评指正。

http://blog.sina.com.cn/s/blog_149e9d2ec0102vput.html


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 对话框_终极版
{
    publicpartial 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 andSettingsAdministrator桌面新建文本文档.txt"
                               );
       }

                                     


    }
}


最后

以上就是壮观唇彩为你收集整理的MessageBox.Show()的使用的全部内容,希望文章能够帮你解决MessageBox.Show()的使用所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部