Well, the gradient fill seems to be complicated, how about this?
Put a picturebox in a form, set it's Autoredraw property to
True
VB Code:
  1. Private Sub Picture1_Click()
  2. Dim FR, FG, FB, LR, LG, LB
  3. Dim SR, SG, SB
  4. 'Any value between 0 and 255 will do for these variables
  5. 'They determine ur first color and last color
  6. FR = 255: FG = 0: FB = 255
  7. LR = 0: LG = 255: LB = 0
  8. With Picture1
  9. SR = (LR - FR) / .Width
  10. SG = (LG - FG) / .Width
  11. SB = (LB - FB) / .Width
  12. For X = 0 To .Width
  13. .Line (X,0) - (X, .Height), RGB(FR, FG, FB)
  14. FR = FR + SR: FG = FG + SG: FB = FB + SB
  15. Next
  16. End With
  17. End Sub
Now, this would be too slow, How about this?
This is a few thousand times faster...
VB Code:
  1. Prinvate Sub Picture1_Click()
  2. Dim FR, FG, FB, LR, LG, LB, PCol, Col, PX
  3. 'Any value between 0 and 255 will do for these variables
  4. 'They determine ur first color and last color
  5. FR = 255: FG = 0: FB = 255
  6. LR = 0: LG = 255: LB = 0
  7. PCol = RGB(FR, FG, FB): PX = 0
  8. With Picture1
  9. SR = (LR - FR) / .Width
  10. SG = (LG - FG) / .Width
  11. SB = (LB - FB) / .Width
  12. Do Until X >= .Width
  13. Col = RGB(FR, FG, FB)
  14. If PCol <> Col Then
  15. .Line (PX, 0) - (X, .Height), PCol, BF
  16. PCol = Col
  17. PX = X
  18. End If
  19. X = X + 1
  20. FR = FR + SR: FG = FG + SG: FB = FB + SB
  21. Loop
  22. End With
  23. End Sub