sasllc
asked on
How to handle YesNoCancel in vb.net project?
I have always used this code to handle a Yes or No answer:
If MsgBox(psWork1, MsgBoxStyle.YesNo, "Clear Verify File?") = vbYes Then
sPassParam0 = "ShpVerInit"
Else
sPassParam0 = "ShpVerAppend"
End If
This was easy, because if it was not "vbYes", then it obviously had to be "No". But now I need to add the Cancel option, i.e. MsgBoxStyle.YesNoCancel, but I don't know how to do the If-Then syntax with this 3rd option. If they choose "Cancel", I want to Exit Sub, but what is the proper syntax in this case? TIA
If MsgBox(psWork1, MsgBoxStyle.YesNo, "Clear Verify File?") = vbYes Then
sPassParam0 = "ShpVerInit"
Else
sPassParam0 = "ShpVerAppend"
End If
This was easy, because if it was not "vbYes", then it obviously had to be "No". But now I need to add the Cancel option, i.e. MsgBoxStyle.YesNoCancel, but I don't know how to do the If-Then syntax with this 3rd option. If they choose "Cancel", I want to Exit Sub, but what is the proper syntax in this case? TIA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.