Rishabh Rishabh - 2 years ago 76
Vb.net Question

How do I take the result from a message box?

In Visual Basic in Visual Studio 2010, if this is used for giving a message,

MsgBox("hello", 4, "status")

how do I manipulate the result Yes or No from the msgbox?

Like this should happen if the user gives No and this should happen if No.

Answer Source

You need to check whether MsgBox returned vbYes.

For example:

If vbYes = MsgBox("hello", vbYesNo, "status") Then
    'Do things
    'Don't do things
End If
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download