Autor Beitrag
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 12:25 
Wie kann ich in einer TEdit-Komponente richtig scrollen?

wenn ich es mit der
ausblenden Delphi-Quelltext
1:
Edit1.ScrollBy()					
funktion mache, dann wird nur "Pseudo-gescrollt". Soll heissen, es sieht nur nach scrollen aus, is aber aber kein scrollen.

Also, wenn ihr mich verstanden habt (was zugegebenermaßen in dem Fall nicht leicht ist), dann helft mir bitte!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 21.12.05 12:28 
Ein TEdit hat nur eine Zeile, was willst du da scrollen?
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 12:30 
Nicht nach oben oder unten! *lol*

Sondern nach links bzw. nach rechts. 8-)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 21.12.05 12:40 
Suchst du eventuell die Eigenschaft SelStart?
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 12:45 
Habs ausprobiert...
Das behebt nicht wirklich mein Problem.

Ich möchte z.B. bei ButtonOnClick um 10 Zeichen nach rechts bzw. links scrollen.
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 12:57 
Okay, hab ne Lösung.
Es funktioniert doch mit SelStart.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure formcreate
begin
Edit1.Selstart := 50;
end;

procedure buttonclick
begin
edit1.Selstart := (edit1.Selstart + 50);
end;


danke für die hilfe!
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 13:02 
Okay, die Lösung ist mist...

Ich will dynamisch scrollen.
zB. wenn der text so lang ist dass er nicht mehr ins edit reinpasst....
und SO funktioniert das nicht. (leider)
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 21.12.05 13:10 
Mit scrollbar:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.Edit1Change(Sender: TObject);
begin

scrollbar1.PageSize := 100;

if length(edit1.Text) > 10 then
begin
  scrollbar1.Min := 0;
  scrollbar1.PageSize := 100 - length(edit1.Text);
  scrollbar1.Position := length(edit1.Text);
 end;
end;

procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
  edit1.SelStart := scrollbar1.Position;
end;


hoffe konnt dir weiterhlefen ;)
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 13:16 
Danke, die Lösung ist anwendbar... aber nicht für mich ;-) ;-)
Ich möchte scrollen wie auf einer Website zum beispiel.
also flüssig.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 21.12.05 13:22 
ja das is richtig, weil pagesize dann negativ wird :roll:
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 13:25 
das hab ich schon bemerkt, behoben und den post geändert *grins*
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 14:01 
So ist die Lösung perfekt:
(edtWert ist ein TEdit und scrbWert ist die dazugehörige TScrollBar)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TfrmMain.edtWertChange(Sender: TObject);
begin
scrbWert.Max := length(edtWert.Text);
scrbWert.PageSize := 0;
end;

procedure TfrmMain.scrbWertChange(Sender: TObject);
begin
edtWert.SelStart := scrbWert.Position;
end;
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 21.12.05 14:11 
ganz ehrlich, aber bei mir scrollt er mit deiner lösung immernoch nicht flüssig :lol:
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 14:14 
vielleicht nicht flüssig, aber dafür bis zum ende des textes.
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Mi 21.12.05 16:48 
"flüssig scrollen" soll soviel heißen wie nicht um Zeichen sondern um einzelne Pixel verschieben?
Das lässt sich zum Beispiel über Canvas realisieren. zb über Textout
Dann musst du nur im Intervall den x-wert um 1-Stelle verschieben und fertig :D

_________________
I believe that every human has a finite number of heart-beats. I don't intend to waste any of mine running around doing exercises.
- Neil Armstrong
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 16:54 
ja, dann schreib du mal einfach auf die form drauf.
Ich nehme benutzereingaben lieber weiterhin über Editfelder entgegen.. *grins*
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 21.12.05 17:06 
warum benutzt du nicht einfach n richedit? is doch von prinzip her das gleiche! :roll:
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Do 22.12.05 09:02 
Müsste das nicht auch mit einer TMemo funktionieren. :gruebel:

_________________
Ein Nutzer der Ecke ;-)
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Do 22.12.05 09:40 
ich benutze TEdit, weil die eingabe maximal eine zeile haben darf.