Autor Beitrag
yellomb
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21


D6
BeitragVerfasst: Sa 21.05.05 15:23 
Hallo Leute!
Angenommen ich füge mittels Button.click Text an der aktuellen Cursor-Position ins SynEdit ein,
klicke ich dann wieder in das Synedit, dann springt der Cursor wieder in die erste Zeile,
hat jemand eine Ahnung woran das liegt und wie man den Cursor wieder an die Position
bekommt wo der Text eingefügt wurde??

Grüße
spike0
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Sa 21.05.05 15:48 
Ich glaube es könnte so gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var 
i:integer;
text:string;
begin
i:=Synedit1.Selstart;

text:='Dein Text, der eingefügt werden soll.';
Synedit1.Seltext:=text;

Synedit1.Selstart:=i+Length(text);
yellomb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21


D6
BeitragVerfasst: Sa 21.05.05 18:37 
Danke für deine Antwort, aber auch das funktioniert nicht
der Cursor springt trotzdem wieder in die erste Zeile.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 21.05.05 18:41 
Setz mal SelEnd = SelStart

AXMD