messagebox buttons result

juggernot

Well-known member
Joined
Sep 28, 2006
Messages
173
Programming Experience
Beginner
I'd like to know how to make a button in a message box do something in addition to closing the messagebox. Where and how do i code messagebox buttons?
 
VB.NET:
Select Case Messagbox.Show(....)
  Case DialogResult.Yes
  Case DialogResult.No
End Select
just add a case statement for the button pressed on the messagebox
 
To elaborate on JB's post in case it isn't clear, the buttons on a MessageBox don't do anything other than close the dialogue and make Show return the corresponding DialogResult value. It's then up to the calling form to test that return value to see what it is and then act appropriately. The MessageBox itself doesn't do anything.
 
Back
Top