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?
Best Answer
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.