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?
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 a Lot ..
Thanks. It worked in my VB2010 also.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.