Autor Beitrag
Killi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 299

Win*
D6 Prof
BeitragVerfasst: Fr 18.07.03 16:45 
Hi!

Wie mache ich es am geschicktesten dass eine Eingabe in ein Edit-Feld (ä, ü, ö) zu AE, OE, UE wird? Habe es schon probiert - aber nur etwa so (ausm Kopf):
ausblenden Quelltext
1:
if key = 'ä' then begin key:= 'A'; //hier hinter noch ein E gesetzt					

da ich das E dahinter setze, macht es keinen Sinn wenn der Cursor mitten in einem Edit-Feld steht - da kommt dann in der Mitte ein A und am ENDE des Textes ein E - also gehört nicht zusammen! Wie soll ich es machen?
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Fr 18.07.03 17:23 
Mach das einfach so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Edit1Change(Sender: TObject);
begin
  Edit1.Text := StringReplace(Edit1.Text, 'ä', 'ae', [rfReplaceAll]);
end;


Natürlich geht das auch mit ö und ü.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
Killi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 299

Win*
D6 Prof
BeitragVerfasst: Mo 21.07.03 09:17 
das istr ja echt geil, aber dann springt mein Cursor wieder nach vorne und man shvcreibt wieder am Anfang weiter - wenn mans nicht merkt wird wieder alles verhauen...wie kann ich also die Cursor-Position wieder nach hinten setzen?
Killi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 299

Win*
D6 Prof
BeitragVerfasst: Mo 21.07.03 09:18 
OK, habs schon - mit SelStart! DANKE!!!