When the left mouse button is being held down, and the mouse is moved to a seperate control, is the MouseEnter event of that seperate control not fired? Because I have a grid of picturebox's and I'm trying to set the backcolor of the picturebox's I select based on if my mouse is being held down and moving over them like this:
But when I move my mouse to a different picturebox in the grid, it's backcolor isn't changing.
Code:
Private Sub pb_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
clicked = True
Dim c As PictureBox = DirectCast(sender, PictureBox)
Select Case style
Case PenStyle.Regular
c.BackColor = currentcolor
Case PenStyle.Eraser
c.BackColor = transparentColor
End Select
End Sub
Private Sub pb_Enter(ByVal sender As Object, ByVal e As EventArgs)
Dim c As PictureBox = DirectCast(sender, PictureBox)
If clicked Then
Select Case style
Case PenStyle.Regular
c.BackColor = currentcolor
Case PenStyle.Eraser
c.BackColor = transparentColor
End Select
End If
End Sub
Private Sub pb_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
clicked = False
End Sub