I was experimenting with message boxes, and tried a simple yes/no messagebox So I wrote this simple piece of code. However, the \"chc\" variable always returns as 1, no matt
The MsgBox()
method is returning MsgboxResult
Enumeration, check the value that the method returns:
Public Sub MsgBoxExample()
Dim result As MsgBoxResult = Nothing
Dim chc As Integer
result = MsgBox("click something...", vbYesNo, "example")
If result = MsgBoxResult.Yes Then
chc = 1
ElseIf result = MsgBoxResult.No Then
chc = 0
End If
MsgBox(chc)
End Sub