0

how can i put an if statement in a OkCancel Msgbox ..

for example when i choose OK .. it will perform the code ..

and if I Cancel it will not perform the code?

3
Contributors
3
Replies
12
Views
7 Years
Discussion Span
Last Post by avtaars
0
Dim result As DialogResult = MessageBox.Show("Some text", "Some caption", MessageBoxButtons.OKCancel)
        If result = Windows.Forms.DialogResult.OK Then
            'do something

        ElseIf result = Windows.Forms.DialogResult.Cancel Then
            'do something else

        End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.