Autor Beitrag
brainkopf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP; Win 7
C# (VS 2005/2008)
BeitragVerfasst: Do 15.11.07 20:34 
Hi,
also ich würde gerne einen HTML Editor programmieren. Er ist eigentlich auch schon fuktionsfähig, allerdings fehln noch ein paar Spielerreien!
Zum Beispiel würde ich gerne (evtl. mit Lines.Add) vor und hinter einen markierten Text im Memo einen vorgegeben Text einfügen (also zum Beispiel: <b>markierter Text</b>).
Ist da smit Lines.Add möglich?
Wenn nicht, ist das möglich und wenn wie?

Ich bin noch nicht so begabt in Delphi, also bin ich um eine detaillierte Anleitung sehr dankbar!

mfg
brainkopf
Shorty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 107

Win XP, Ubuntu 8.04
Delphi 7 Prof., Delphi 2005 Pers.
BeitragVerfasst: Do 15.11.07 22:03 
Also erstmal hallo und :welcome: im Delphi-Forum!

Guck dir am besten mal die Einträge für die Insert-Prozedur, SelStart und SelLength in der Delphi-Hilfe an, das sollte genau das sein, was du brauchst.

MfG Shorty
brainkopf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP; Win 7
C# (VS 2005/2008)
BeitragVerfasst: Do 15.11.07 23:16 
Danke. Dann werde ich mir die Hilfe mal durchlesen. Ich melde mich dann nochmal.
brainkopf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP; Win 7
C# (VS 2005/2008)
BeitragVerfasst: Fr 16.11.07 17:01 
Hi nochmal,
also durch die Hilfe bin ich nicht viel schlauer geworden.
Ich weiß jetzt zwar das ich mit SelStart den Anfang einer markierung herausfinden kann und mit SelLength die Länge, aber in meinem Problem hilft mir die Hilfe nur minimal weiter.


Nochmal zur verdeutlichung. ich hab nen Knopf, wenn ich da drauf drücke sollte um den markierten Text was bestimmtes stehen. Der markierte Text soll aber NICHT ersetz werden.

mfg
brainkopf
Shorty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 107

Win XP, Ubuntu 8.04
Delphi 7 Prof., Delphi 2005 Pers.
BeitragVerfasst: Fr 16.11.07 17:30 
Isert fügt einen String an einem bestimmten Index ein, füg den jeweiligen Text doch einfach an der Stelle SelStart und SelStart+SelLength ein, dann sollte der um die Markierung sein, ansonste einfach noch mit +1 bzw -1 abändern...
ssb-blume
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 375
Erhaltene Danke: 7

XP, W7, W8
Deutschland
BeitragVerfasst: Fr 16.11.07 17:57 
Hallo,
wenn der Text markiert ist, und das sollte er für diese Funktion sein, kann einfach mit der Funktion memo1.seltext dieser Test geholt werden und durch einfache Textoperation wie

ausblenden Delphi-Quelltext
1:
memo1.seltext:='<b>'+memo1.seltext+'</b>';					


dies erledigt werden.

_________________
Brain: an apparatus with which we think we think.
brainkopf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP; Win 7
C# (VS 2005/2008)
BeitragVerfasst: Fr 16.11.07 18:08 
VIELEN DANK!
Es funktioniert und ich bereue es nicht mich registriert zu haebn ;)
Nochmal Danke!