如何在c#中更改MessageBox的大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11358509/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change the size of MessageBox in c#?
提问by Sunny
Possible Duplicate:
C# formatting a MessageBox
可能的重复:
C# 格式化 MessageBox
how to change the size of windows default MessageBox in c# . Is there any code for it ? i dont want to make my personalised dialog box ? so is there any solution to change the windows default messagebox size?
如何在 c# 中更改 windows 默认 MessageBox 的大小。有什么代码吗?我不想制作我的个性化对话框?那么是否有任何解决方案可以更改 Windows 默认消息框大小?
采纳答案by burning_LEGION
create custom form and set properties as you want
创建自定义表单并根据需要设置属性
回答by TOP KEK
回答by Cyral
You should try and make a custom class, that holds your design/properties.
您应该尝试制作一个自定义类,以保存您的设计/属性。
You could make a function in your custom message box class, that will call your "Bigger messagebox" and set the text
您可以在自定义消息框类中创建一个函数,该函数将调用您的“更大的消息框”并设置文本
CustomBox.Show("sdhsfs")
CustomBox.Show("sdhsfs")
Thismay help with the class (You will have to add a size Tag to the constructor)
这可能对类有所帮助(您必须在构造函数中添加一个大小标签)
Also, the tutorial uses static methods, make an instance instead. This will allow multiple message boxes, all with different text.
此外,本教程使用静态方法,而是创建一个实例。这将允许多个消息框,所有消息框都具有不同的文本。

