The Scroll Text Program

This program comes out of the examples of Gambas: ( DataReportExample) where you find it in the form Fabout.

You need a scrollview field on your form to get the program going. You have to put a textlabelfield into the scrollview field. Furthermore you need 2 commandbuttons and a timer.

The long text, which will be scrolled automaticly, must be placed into the textlabel.text Take any longer text and copy it via clipboard in this place.

As an alternative you also could put the the long text into the code like this Textlabel1.Text = "long text .........." textlabel1.text = textlabel1.text & "some more text " May be you have to care for the CR and LF then by adding chr(13) & chr(10) .

The Code

    ' Gambas class file
    PUBLIC SUB Form_Open()
     ME.center
    Timer1.Enabled = True
    END
    PUBLIC SUB Timer1_Timer()
    DIM Y AS Integer
    Y = ScrollView1.ScrollY
    INC ScrollView1.ScrollY
    IF Y = ScrollView1.ScrollY THEN ScrollView1.ScrollY = 0
    END
    PUBLIC SUB Button1_Click()
     ME.close
    END
    PUBLIC SUB Button2_Click()
     Timer1.Enabled =FALSE
    ' stops the automatic Scrollview
    END

-- ReinerHoffmann - 22 Sep 2004