Link to home
Start Free TrialLog in
Avatar of sasllc
sasllcFlag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial