Autor Beitrag
mirage228
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 338

Win 7 Prof.
Delphi 2005 Prof., Delphi 2010 Prof.
BeitragVerfasst: So 20.07.03 15:15 
Hallo,

wenn ich manuell einen Text in ein RichEdit einfüge (als RichEdit1.Text := RichEdit1.Text + Irgendwas; oder halt per RichEdit1.Lines.Add(Irgendwas) ) kann ich dies nicht wieder rückgängig machen. Gibt es eine Methode mit der ich den Text so einfügen kann, das das auch wieder rückgängig zu machen ist (mit EM_UNDO)?

thx
mirage228

_________________
May the source be with you, stranger.
Nero
Hält's aus hier
Beiträge: 9



BeitragVerfasst: So 20.07.03 16:22 
Also bei mir funzt diese Methode. Egal wie ich den Text einfüge
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  RichEdit1.Perform(EM_UNDO, 0, 0);
end;


Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.

_________________
Das schlimmste für einen Progger ist Sonnenschein und dieses fürchterliche Vogelgzwitscher
mirage228 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 338

Win 7 Prof.
Delphi 2005 Prof., Delphi 2010 Prof.
BeitragVerfasst: So 20.07.03 17:03 
Bei mir geht es so leider nicht...

_________________
May the source be with you, stranger.
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: So 20.07.03 18:26 
ausblenden Delphi-Quelltext
1:
RichEdit1.Undo					


Keine Ahnung, wieviel das löscht, könntest aber auch so machen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
[...]
var temp: string;
[...]

procedure TForm1.Hinzufuegen(Sender: TObject);
begin
temp:= RichEdit1.Text;
RichEdit1.Lines.Add('Irgendwas');
end;

//--------------------------

procedure TForm1.Rueckgaengig(Sender: TObject);
begin
RichEdit1.Text:= temp;
end;


Stefan

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: So 20.07.03 20:27 
Hallo StefanH,

damit gehen doch aber auch die formatierungen verloren...
Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 21.07.03 16:08 
CenBells hat folgendes geschrieben:
Hallo StefanH,

damit gehen doch aber auch die formatierungen verloren...
Gruß
Ken


:roll: stimmt. Dann speicher`s halt in die Zwischenablage

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Guardian of R'lyeh
Hält's aus hier
Beiträge: 14

Windows9x, WindowsXP
D7 Prof
BeitragVerfasst: Do 24.07.03 12:13 
oder nen Stream...dann kann es nicht irgendwie verloren gehen, wenn ein anderes Programm was mit der Zwischenablage macht ;)