Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   TScrollbar (https://www.delphipraxis.net/96590-tscrollbar.html)

axmarq 27. Jul 2007 07:45


TScrollbar
 
Hallo,

ich habe ein Problem mit der TScrollbar Komponente. Ich habe ein Memo mit 7 Zeilen Anzeigengröße. Der Text, der geladen wird, ist aber 18 Zeilen groß. Folgenden Code habe ich nun für das Scrollbar-OnChange-Ereignis hinterlegt:

Delphi-Quellcode:
procedure TForm1.ScrollBar1Change(Sender: TObject);
var s1, i: integer;
begin
s1 := 0;
  for i := 0 to ScrollBar1.Position-1 do
    s1 := s1 + length(Memo1.Lines[i]);
  Memo1.SelStart := s1;
  Memo1.SelLength := 1;
end;
Das scrollen funktioniert, aber nur bis zu Zeile 14. Dann läßt es sich nicht mehr weiter scrollen. Die PageSize der Komponente ist 2.

Könnt Ihr mir sagen, wo der Fehler liegt?

Danke und Gruß,
axmarq

Matze 27. Jul 2007 08:11

Re: TScrollbar
 
Hallo,

ich verstehe nicht ganz, was du vorhast. Wenn du nur das Memo scrollen möchtest, schaue dir mal die Eigenschaft ScrollBars des Memos im Objektinspektor an.

axmarq 27. Jul 2007 18:29

Re: TScrollbar
 
Danke, das war ja einfach. Ich habe ewig rumgesucht und mich gefragt warum das nicht funktioniert.

Also, nochmal besten Dank.

axmarq


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:31 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz