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?

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

Thanks. It worked in my VB2010 also.