This will give you the idea, although it paints from top to bottom it shouldn't be difficult to modify it...put it in the form's paint event.
Dim i As Integer
Dim c As Integer
Dim W As Integer
On Error GoTo FPErr
DrawStyle = 6
DrawMode = 13
DrawWidth = 2
ScaleMode = 3
ScaleHeight = 512
c = 0
W = Me.Width
For i = 0 To 255
Line (0, i)-(W, i + 1), RGB(c, c, c), B
c = c + 1
Next i