Re: How to not clear Label line before

Posted by Jenny

In Reply to How to not clear Label line before posted by Ardely

: here are an part from my config, the staff is to show from the same line Label a text files
: and than on the second line an other text with the same Label.Top +10
: My problem is when I show the second line Label.Top +10
: the first show line on my form is clear, I see only the second. How Can I make to not clear on my form the line
: before!

: VTop := 30;
: VLeft := 60;
: AssignFile(FichTest, Fich);
: Reset(FichTest);
: while not Eof(FichTest) do BEGIN
: Readln(FichTest, tmpS);
: Form2.label1.Top:= vTop;
: Form2.label1.Caption:=tmpS;
: VTop := VTop + 10;
: end;
:
: Great thanks for your help.
: Ardely
--------------------

You display every line of the text file in the SAME "label1" component. What you do is basically the following:

Label1.Text := '1';
Label1.Top := Label1.Top + 10;
Label1.Text := '2';
Label1.Top := Label1.Top + 10;
Label1.Text := '3';
Label1.Top := Label1.Top + 10;

Your code would work if you use ANOTHER label for each line of the text file, something like this:

Label1.Text := '1';
Label2.Text := '2';
Label2.Top := Label1.Top + 10;
Label3.Text := '3';
Label3.Top := Label1.Top + 20;
and so on...

Related Articles and Replies