Raddict
Active member
Hi,
I normaly use msgboxes only for informing the user. Now I want to use the cancelbutton to let my program run another subroutine than the ok button.
Can anyone help me with this?
I tried:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("ok=greenen cancel=red", MsgBoxStyle.OKCancel, "test")
If MsgBoxResult.OK Then
Button1.BackColor = Color.Green
Else
Button1.BackColor = Color.Red
End If
End Sub
But it always causes the button to turn green
I normaly use msgboxes only for informing the user. Now I want to use the cancelbutton to let my program run another subroutine than the ok button.
Can anyone help me with this?
I tried:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("ok=greenen cancel=red", MsgBoxStyle.OKCancel, "test")
If MsgBoxResult.OK Then
Button1.BackColor = Color.Green
Else
Button1.BackColor = Color.Red
End If
End Sub
But it always causes the button to turn green