Add the following program code to Form_Load
SubForm_Load()
Form1.AutoRedraw=True
'Enable automatic redrawing of the Form object
Form1.DrawStyle=6
'The style of the straight line is inner solid line (6-vbInsideSolid)
Form1.DrawMode=13
'copyPen - the color specified by the ForeColor property. (13-vbCopyPen)
Form1.DrawWidth=2
'The output line width is 2 pixels (Pixel)
'Create a custom coordinate scale for plotting or printing
'Graphics pixel is the smallest unit of monitor or printer resolution
Form1.ScaleMode=3
'Set the measurement unit of object coordinates to pixels (3-VbPixels)
Form1.ScaleHeight=(256*2)
'Set the vertical measurement unit value to 512
Fori=0To255
Form1.Line(0,Y)-(Form1.Width,Y 2),RGB(0,0,i),BF
Y=Y 2
Nexti
'RGB(red,green,blue)
'B: Draw a square using the coordinates of the opposite corner of the specified square
'F: Specifies that this square is filled with the color used to draw the square (F can only be used if B is present)
EndSub->