The Sunset Program

When you need a background for a program, you can use this little color sunset program.

You need a drawing area on your form to get the program going. You can choose differnt colours, when you use the following scheme:

Blue RGB(0, 0, i) Red RGB(i, 0, 0) Green RGB(0, i, 0) Yellow RGB(i, i, 0) Violett RGB(i, 0, i) Türkis RGB(0, i, i) Gray RGB(i, i, i)

How does it look like ?

The Code

    PUBLIC SUB Form_Open()
    DIM r AS Integer
    DIM g AS Integer
    DIM b AS Integer
    DIM h AS Integer
    DIM he AS Integer
    DIM sHex AS String
    r = 0
    g = 0
    FOR b = 0 TO 255
    sHEX = Hex$(r,2) & Hex$(g,2) & Hex$(b,2)
    sHEX = "&H" & sHEX & "&"
    Draw.begin(DrawingArea1)
    Draw.Forecolor= Val(sHEX)
    Draw.LineWidth=5
    he = DrawingArea1.Height
    h = he * b \ 255
    Draw.Line(0, h, DrawingArea1.Width, h)
    Draw.End
    NEXT
    END

You can make the program better, when you add the following code and change the border of the form to Resizeable.

    PUBLIC SUB Form_Resize()
     DrawingArea1.Move(0, 0, ME.ClientWidth, ME.ClientHeight)
    END

-- ReinerHoffmann - 16 Feb 2004