Autor Beitrag
110022
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: So 02.12.07 14:35 
wie begrenzt man die zeichen in einem editfeld??
wenn 2 zeichen eingetragen wurden soll keins mehr eingetragen werden.
wie gehts?
Mr. Hunt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: So 02.12.07 14:43 
Eine frage.

Buchstaben (String)
oder Zahlen (Integer)
oder Beides??
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: So 02.12.07 14:44 
egal
haupsache zeichen
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 02.12.07 14:45 
Schau Dir mal die Eigenschaften von TEdit an, wenn Du nicht weisst was sie bedeuten anklicken und F1.
Dann wirst Du auch finden was Du suchst.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: So 02.12.07 14:52 
dauert leider zu lange.
dachte hier gibts profis :D
die sich mit delphi auskennen :D
Mr. Hunt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: So 02.12.07 14:55 
bei Eigenschaften des EditFeldes in MaxLength : '2' eintragen

fertig.

oder komplizierter. Bei Form1.Ereignisse OnCreate:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.MaxLength:=2;
end;


MfG


Zuletzt bearbeitet von Mr. Hunt am So 02.12.07 14:56, insgesamt 1-mal bearbeitet
PeterPain
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83



BeitragVerfasst: So 02.12.07 14:56 
Nein, nich nur profis, aber ich bin mal so frei

ausblenden Delphi-Quelltext
1:
2:
  if (Length(TEdit(Sender).Text) >= 2) and (Ord(Key) <> VK_DELETE) and (Ord(Key) <> VK_BACK) then
    Key := #0;


das ins OnKeyPress und bla
PeterPain
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83



BeitragVerfasst: So 02.12.07 14:57 
user profile iconMr. Hunt hat folgendes geschrieben:
bei Eigenschaften des EditFeldes in MaxLength : '2' eintragen

fertig.


Oh, was es so alles gibt :D
Mr. Hunt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: So 02.12.07 14:59 
ja so ghehts auch, wobei das einfachste immer noch ist:

ausblenden Delphi-Quelltext
1:
Edit1\Eigenschaft\MaxLenght:2					



user profile iconPeterPain hat folgendes geschrieben:
user profile iconMr. Hunt hat folgendes geschrieben:
bei Eigenschaften des EditFeldes in MaxLength : '2' eintragen

fertig.


Oh, was es so alles gibt :D


EDIT: ja nicht war?? Delphi ist richtig schlau xD
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: So 02.12.07 15:04 
hätte eigendlich selber drauf kommen müssen :D
danke
Atreyu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: So 02.12.07 17:55 
Du solltest erst fragen, wenn du wirklich jede Eigenschaft oder Events eines Objekts geprüft hast.
Mr. Hunt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: So 02.12.07 17:59 
bin ich grundsätzlich auch für (Vorallem wenns ein so deutlich name ist: MaxLenght)
aber manchmal weis man echt nicht was damit gemeint ist. und dann fragt man lieber nach
Atreyu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: So 02.12.07 18:02 
Naja, es gibt ja noch F1, dort wird ja auch viel erklärt (okay, je nach IDE)...
Dunkel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 682

Mac OS X Snow Leopard
Xcode 3.1
BeitragVerfasst: So 02.12.07 18:04 
user profile iconMr. Hunt hat folgendes geschrieben:
aber manchmal weis man echt nicht was damit gemeint ist. und dann fragt man lieber nach

...oder man drückt einfach mal F1; geht sogar noch schneller als im Forum ein neues Thema zu eröffnen. :roll:

_________________
Ich streite einsam mich mit dieser Oberflächenwelt
Gutes sei ein löblich Brot von dem ich zehre - bis zum Tod [Das Ich - Im Ich]