Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Curosr in TEdit ans Ende setzen (https://www.delphipraxis.net/165471-curosr-tedit-ans-ende-setzen.html)

Frickler 9. Jan 2012 17:32

AW: Curosr in TEdit ans Ende setzen
 
Es ginge natürlich auch ein eigenes Ereignis, z.B. so:

Delphi-Quellcode:
const WM_AFTERENTER = 50;

// mit der passenden Methode

procedure WMAfterEnter(var Msg: TMessage); message WM_AFTERENTER;

// und dann:

procedure TForm1.EditURLEnter(Sender: TObject);
begin
  PostMessage(Handle, WM_AFTERENTER, 0, 0);
end;

procedure TForm1.WMAfterEnter(var Msg: TMessage);
begin
  if EditURL.Enabled and (Length(EditURL.Text) = 0) then begin
    EditURL.Text := 'http://';
    EditURL.SelStart := EditURL.GetTextlen;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:11 Uhr.
Seite 3 von 3     123   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz