Apu_Shah
asked on
VB YES NO CANCEL - VB.NET Visual studio 2003 Message box
I bulding a windows application using visual studio 2003. Vb.net
I want to show a messagebox with yes no and cancel button on it.
messagebox.show("Message", ------------ )
also let me know, how to grab the output of the selection made from the messagebox.
please help me in this simple question.
Thanks
I want to show a messagebox with yes no and cancel button on it.
messagebox.show("Message",
also let me know, how to grab the output of the selection made from the messagebox.
please help me in this simple question.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This should do it
Dim Message As String = "Message"
Dim Caption As String = "Error Caption"
Dim Buttons As MessageBoxButtons = MessageBoxButtons.YesNoCan cel
Dim Result As DialogResult
'Displays the MessageBox
Result = MessageBox.Show(Message, Caption, Buttons)
' get the user selection
If Result = Windows.Forms.DialogResult .Yes Then
'Or Result=Windows.Forms.Dialo gResult.No
'Or Result=Windows.Forms.Dialo gResult.Ca ncel
' Do something
End If
Dim Message As String = "Message"
Dim Caption As String = "Error Caption"
Dim Buttons As MessageBoxButtons = MessageBoxButtons.YesNoCan
Dim Result As DialogResult
'Displays the MessageBox
Result = MessageBox.Show(Message, Caption, Buttons)
' get the user selection
If Result = Windows.Forms.DialogResult
'Or Result=Windows.Forms.Dialo
'Or Result=Windows.Forms.Dialo
' Do something
End If
ASKER
Thanks all,
All answers are correct.
ZeonFlash response time was good enough to get him points.
Thanks
All answers are correct.
ZeonFlash response time was good enough to get him points.
Thanks
intResult = MessageBox.Show("Message",
Select Case intResult
Case DialogResult.Yes
......
Case DialogResult.No
......
Case DialogResult.Cancel
......
End Select