Einzelnen Beitrag anzeigen

dominikkv

Registriert seit: 30. Sep 2006
Ort: Gundelfingen
1.109 Beiträge
 
Delphi 2007 Professional
 
#3

Re: Text einfügen + Focus bei Editfeld

  Alt 8. Feb 2007, 16:02
Zitat von hoika:
Hallo,

nach dem SetFocus
SelStart / SelLength (0) verwenden


Heiko
danke...
ich habs jetzt geschafft:
Delphi-Quellcode:
procedure InsText(s: String);
var
   t: String;
   n: Byte;
begin
  with Form1.Eingabe do
    begin
      t := Text;
      n := SelStart;
      if n=0 then
        Text := Text + s else
          begin
            Insert(s, t, n+1);
            Text := t;
          end;
      SetFocus;
      SelLength := 0;
      SelStart := n+length(s);
    end;
end;
Dominik
  Mit Zitat antworten Zitat