MessageBox中的自定义按钮 [英] custom buttons in MessageBox

查看:1372
本文介绍了MessageBox中的自定义按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在MessageBox中创建自定义消息?我想要一个带有以下内容的MessageBox:

文字:这是个人客户还是公司客户?

标题:新客户

按钮:三个按钮(个人,公司,取消)

解决方案

MessageBox类虽然非常有用,但也有一点局限性,因为您无法通过继承或其他外部方式以及何时覆盖此类内容它提供的功能还不够,您的下一个最佳选择就是创建自己的对话框,就像创建所需形状和大小以及所需按钮并在其上调用ShowDialog()那样简单的对话框一样简单.

 

How can I create my custom messages in the MessageBox? I want to have a MessageBox with the following:

Text : Is this an individual or corporate customer?

Caption: New Customer

Buttons: Three buttons (Individual, Corporate, Cancel)

 

 

解决方案

The MessageBox class while very useful is also a bit limiting as you cannot override things like that through inheriting or other external means and when what it offers isn't enough your next best bet is to make your own which is as simple as creating your own dialog form in the shape and size you want and with the buttons you want and call ShowDialog() on it.


这篇关于MessageBox中的自定义按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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