Board index » delphi » Text Scrolling

Text Scrolling

How can I make a txt file scroll on a form ? Not line by line...all the text
together...
 

Re:Text Scrolling


Quote
Tassos Voulgaris wrote:

> How can I make a txt file scroll on a form ? Not line by line...all
> the text
> together...

I believe you're struggling with this (type of) problem for some time
now, am I right? What exactly do you need? Perhaps you could have a look
at a screensaver I made which has scrolling text (StarWars-style). It
isn't very fast because of the prespective but the trick here was to use
a bitmap on which to draw the text.

Remco

http://www.xs4all.nl/~remcodek/download.html#scrollie

Re:Text Scrolling


You have to be more specific, about what exactly you need.
I assume you want soft scroll of text.

You can try the following:

1. Put a Scrollbox on your form (size it 200x200 or so)
2. Put a Paintbox into the Scrollbox
3. In the object inspector: Set PaintBox1.Align to top and PaintBox1.Height to
something like 400
4. In the object inspector: Set ScrollBox1.VertScrollBar.Increment to 1 and
      ScrollBox1.VertScrollBar.Tracking to True
5. Generate a PaintBox1.OnPaint-event like this:

procedure TForm1.PaintBox1Paint(Sender: TObject);
var
  j : Integer ;
begin
  With PaintBox1.Canvas do
  begin
    for j := 0 to 24 do
      TextOut(8, 16*j, 'Line ..'+inttostr(j)) ;
  end ;
end;

and run this program. Now the text scolls smoothly.

Is this, what you want ? or please be more specific.

KH Brenner

Quote
Tassos Voulgaris wrote:
> How can I make a txt file scroll on a form ? Not line by line...all the text
> together...

Re:Text Scrolling


? Tassos Voulgaris <rom...@hotmail.com> Y???? ?? T? ??T???:
86fp9s$lo...@bornews.borland.com...

Quote
> How can I make a txt file scroll on a form ? Not line by line...all the
text
> together...

<greek text>
Geia sou re patrida!!!!!!!!
</greek text>
If you like to do it the hard (?) way read the help on the "ScrollDC"
Windows API Function. It's the most generic function for any type of
scrolling and it's what every program uses eventually. It's not that
difficult :)

Other Threads