As usual I think I'm losing my marbles. I've started messing about with something that I've steered well clear of since I started with VB about 6 months ago. APIs and picture boxes. I felt I should do something about it, so I started messing about getting comfortable with them before I started doing anything complicated - experimenting with BitBlt and SetPixelV when I noticed something a bit wierd

Maybe someone could explain:-

Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 0 Then
Else:
SetPixelV Picture1.hdc, X, Y, vbBlack
End If
End Sub

now this doesn't really do ne thing out of the ordinary - it just fills in the pixels in the picture box as your mouse moves across it, providing one of the mouse buttons is depressed. Having done that, if you drag another window across the picture box, the little drawing you've made in the picture box vanishes!!!!!

Whoooooo - spooky
Can somebody please explain why??? I would also be muchos grateful if someone could also suggest a suitable solution to my disappearing image solution

Thanx guys
Sam