using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MessageBox按钮
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("你点击了第一个按钮", "第一个按钮", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Warning,MessageBoxDefaultButton.Button3,MessageBoxOptions.DefaultDesktopOnly);

这篇博客详细介绍了如何在Windows Forms应用中使用MessageBox类显示不同类型的对话框,包括AbortRetryIgnore、OK、OKCancel、RetryCancel、YesNo和YesNoCancel等按钮组合,以及各种图标选项,如警告、错误、询问等。示例代码展示了如何响应按钮点击事件并展示不同的消息框。
最低0.47元/天 解锁文章
3万+

被折叠的 条评论
为什么被折叠?



