The picture box will be painted with the color of the pixel that found
under the mouse cursor (no matter if the mouse cursor is inside or outside your
form).
The text box will show the color Long value (or Hex value).
Private Sub Timer1_Timer()
GetCursorPos z
screendc = CreateDC("DISPLAY", "",
"", 0&)
'replace the line below with:
Text1 = Hex(GetPixel(screendc, z.x, z.y))
'if you want that the text box will
show the Hex value of the color (the Hex value is
'used to define colors in
HTML)
Text1 = GetPixel(screendc, z.x,
z.y)
Picture1.BackColor = GetPixel(screendc, z.x,
z.y)
DeleteDC (screendc)
End
Sub