'' to catch the dialog's result output
Dim MessageBoxResult As DialogResult
'' telling what ^ should be getting its result from
'' + your messagebox
MessageBoxResult = MessageBox.Show("Hello World", "Button Test", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
If MessageBoxResult = DialogResult.Yes Then
'' if you click "Yes" then do this
MessageBox.Show("You pressed the Yes button!", "Yes!", MessageBoxButtons.OK, MessageBoxIcon.Information)
ElseIf MessageBoxResult = DialogResult.Cancel Then
'' Alt way of checking
'' if cancel is checked, then do this
MessageBox.Show("You pressed the Cancel button!", "Cancel!", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
'' if you click "No" then do this
MessageBox.Show("You pressed the No button!", "No!", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Comments
0 B
|👍
/👎