I am looking to find something in Visual Basic that basically states that if something collides with something with a certain class, it executes code. I may not be using correct terms, so when I say object I mean like a label or picture box, and a class is... well like a class in HTML, I guess, like an object with a trait.

The pseudocode would look something like this:

```
If object.Bounds.IntersectsWith([object with certain class]) Then execute code

```

Otherwise, the game's 'if' statements will overwhelm... Also I am new to Visual Basic language, so please keep it as simple as possible.

Here is what I have already:

```
    If carblue.Bounds.IntersectsWith(boundary1.Bounds) And directiona = 1 Then
        directiona = 0
        carblue.Top += 2
    ElseIf carblue.Bounds.IntersectsWith(boundary1.Bounds) And directiona = 2 Then
        directiona = 0
        carblue.Left += 2
    ElseIf carblue.Bounds.IntersectsWith(boundary1.Bounds) And directiona = 3 Then
        directiona = 0
        carblue.Top -= 2
    ElseIf carblue.Bounds.IntersectsWith(boundary1.Bounds) And directiona = 4 Then
        directiona = 0
        carblue.Left -= 2
    End If

```

Where carblue is the object being controlled, boundary1 is the obstacle that stops the car from moving (on collision) and directiona is the value of the direction the car is travelling (1 is up, 2 is left, etc).

(Moved from S.A. Programmers site)