Je kan deze code gebruiken volgens mij:
[cpp]Public Class Form1
Dim Box1 As Boolean
Dim Box2 As Boolean
Dim Box3 As Boolean
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Box1 = False
Box2 = False
Box3 = False
End Sub
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
Box1 = True
If Box1 = True And Box2 = True And Box3 = True Then
MsgBox("De actie komt dan hier...", MsgBoxStyle.Information, "Actie")
End If
End Sub
Private Sub PictureBox2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox2.MouseEnter
Box2 = True
If Box1 = True And Box2 = True And Box3 = True Then
MsgBox("De actie komt dan hier...", MsgBoxStyle.Information, "Actie")
End If
End Sub
Private Sub PictureBox3_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox3.MouseEnter
Box3 = True
If Box1 = True And Box2 = True And Box3 = True Then
MsgBox("De actie komt dan hier...", MsgBoxStyle.Information, "Actie")
End If
End Sub
End Class[/cpp]
Of als je wilt dat dit steeds opnieuw gebeurt voeg je volgend stuk code in:
[cpp]Public Class Form1
Dim Box1 As Boolean
Dim Box2 As Boolean
Dim Box3 As Boolean
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Box1 = False
Box2 = False
Box3 = False
End Sub
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
Box1 = True
If Box1 = True And Box2 = True And Box3 = True Then
MsgBox("De actie komt dan hier...", MsgBoxStyle.Information, "Actie")
Box1 = False
Box2 = False
Box3 = False
End If
End Sub
Private Sub PictureBox2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox2.MouseEnter
Box2 = True
If Box1 = True And Box2 = True And Box3 = True Then
MsgBox("De actie komt dan hier...", MsgBoxStyle.Information, "Actie")
Box1 = False
Box2 = False
Box3 = False
End If
End Sub
Private Sub PictureBox3_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox3.MouseEnter
Box3 = True
If Box1 = True And Box2 = True And Box3 = True Then
MsgBox("De actie komt dan hier...", MsgBoxStyle.Information, "Actie")
Box1 = False
Box2 = False
Box3 = False
End If
End Sub
End Class[/cpp]
- link10001000