找传奇、传世资源到传世资源站!

Winform自定义消息框(过几秒可自动消失)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

过几秒可自动消失
from clipboard using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace DemoMessageBox{ public partial class MainForm : Form { public MainForm() { InitializeComponent(); } private void MainForm_Load(object sender, EventArgs e) { //启动线程 MessageBoxHelper.IsWorking = true; MessageBoxHelper.FindAndKillWindow(); } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { //线程终止标识 MessageBoxHelper.IsWorking = false; } private void btnOK_Click(object sender, EventArgs e) { MessageBox.Show(this, "你在吗?", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information); } private void btnYesNo_Click(object sender, EventArgs e) { MessageBox.Show(this, "不好吗?", "请选择", MessageBoxButtons.YesNo,MessageBoxIcon.Question); } private void btnYesNoCancel_Click(object sender, EventArgs e) { MessageBox.Show(this, "出去吗?", "请选择", MessageBoxButtons.YesNoCancel,MessageBoxIcon.Asterisk); } private void btnOkCancel_Click(object sender, EventArgs e) { MessageBox.Show(this, "可以吗?", "警告", MessageBoxButtons.OKCancel,MessageBoxIcon.Warning); } private void btnRetryCancel_Click(object sender, EventArgs e) { MessageBox.Show(this, "重试一次吗?", "错误", MessageBoxButtons.RetryCancel,MessageBoxIcon.Error); } private void btnAbortRetryCancel_Click(object sender, EventArgs e) { MessageBox.Show(this, "重试一次吗?终止吗?", "请选择", MessageBoxButtons.AbortRetryIgnore,MessageBoxIcon.Hand); } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复