如何自定义C#消息框 [英] how to customise c# message box

查看:68
本文介绍了如何自定义C#消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用没有取消按钮创建了一个c#消息框,我希望代码在用户单击取消按钮时保持程序不关闭.简而言之,这意味着当用户单击该取消按钮时,消息框应该不可见;谢谢

I hv created a c# message box with yes no cancel button i want code to keep the program without closing when user click the cancel button . Simply it means when user click that cancel button onlu message box should invisible; thank you

推荐答案

尝试
DialogResult res = MessageBox.Show("Your Message", "Information", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
          if (res == DialogResult.Cancel)
          {
              MessageBox.Show("Your Message"); // Display when user click on cancel button.
          }


这篇关于如何自定义C#消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆