Delphi-PRAXiS
Seite 4 von 4   « Erste     234   

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/)
-   -   Edit Eingabe nur auf Zahlen beschränken, Probleme mit ^ (https://www.delphipraxis.net/119162-edit-eingabe-nur-auf-zahlen-beschraenken-probleme-mit-%5E.html)

DeddyH 22. Aug 2008 13:44

Re: Edit Eingabe nur auf Zahlen beschränken, Probleme mit ^
 
Eine Exception zur Eingabeprüfung? Vielleicht besser so:
Delphi-Quellcode:
procedure TfrmMain.Edit1Exit(Sender: TObject);
var dummy: integer;
begin
  if not TryStrToInt(Edit1.Text, dummy) then
  begin
    Edit1.Text := '0';
    Edit1.SetFocus;
    Edit1.SelectAll;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:06 Uhr.
Seite 4 von 4   « Erste     234   

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