LabRat
LabRat

Reputation: 2014

vb.net messagebox yes.no buttons to have other text?

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?

Upvotes: 2

Views: 8624

Answers (3)

Greg
Greg

Reputation: 55

You can make a custom form, with the custom buttons, and use ShowDialog()

Upvotes: 0

user3972104
user3972104

Reputation:

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

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1038890

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.

Upvotes: 5

Related Questions