vb.net 消息框 yes.no 按钮是否有其他文本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26688434/
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
vb.net messagebox yes.no buttons to have other text?
提问by ABANDOND ACOUNT
The following code is a nice example of generating a message box with two buttons.
以下代码是生成带有两个按钮的消息框的一个很好的示例。
Dim result1 As DialogResult = MessageBox.Show("Would you like to klick yes?", "Example", MessageBoxButtons.YesNo)
Though this is now dictating the question possed to either result in a yes or no answer. What if I want a create and Add buttons instead of Yes and no buttons example being...
虽然这现在决定了所提出的问题,要么导致是或否的答案。如果我想要创建和添加按钮而不是“是”和“无按钮”示例,该怎么办...
Dim result1 As DialogResult = MessageBox.Show("Would you like to create a new customer or add an existing customer?", "New order", MessageBoxButtons.CreateAdd)
How could I achieve sothing like this?
我怎么能做到这样?
回答by Darin Dimitrov
You cannot achieve that with a MessageBox. If you want to customize the look and feel of those boxes you should write your own custom WinForm that you should display instad of using a MessageBox.
您无法通过MessageBox. 如果您想自定义这些框的外观和感觉,您应该编写自己的自定义 WinForm,您应该使用 MessageBox 来显示它。
回答by ABANDOND ACOUNT
Never you cannot do it with a message box, you can create customized winForms to achieve this target. and call it like Form1.ShowDialog()to get it like a message dialog box
使用消息框永远无法做到,您可以创建自定义的 winForms 来实现此目标。并Form1.ShowDialog()像消息对话框一样调用它
回答by Greg
You can make a custom form, with the custom buttons, and use ShowDialog()
您可以使用自定义按钮制作自定义表单,并使用 ShowDialog()

