Autor Beitrag
Bronstein
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Fr 23.06.06 12:08 
Hallo,
ich habe eine MaskEdit mit folgender Formatierung (Datum Zeit)
99/99/0000 !90:00;1;_

Jetzt möchte ich per Code dem Edit einen Wert zuweisen, z.B.:
MaskEdit1.Text := '121220061500';

Jetzt sollte im MaskEdit folgendes drin stehen: 12.12.2006 15:00

Es steht aber nur 00 drin.

Was mache ich flasch

_________________
Es gibt keine dummen Fragen nur dumme Antworten!!!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 23.06.06 12:10 
Das TMaskEdit prüft nur Eingaben und keine Zuweisungen. Du musst die Zuweisung also gleich im korrekten Format machen.
Bronstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Fr 23.06.06 12:16 
Das hat geklappt Lösung:
MaskEdit1.Text := '12.12.2006 15:00';

Jetz habe ich aber bei einem anderen Falle ein Problem.
Die Formatierung dieses MaskEdits sieht folgendesmaßen aus.
75.000.000;1;_

Hier habe ich folgendes versucht:
MaskEdit3.Text := '123.456';
MaskEdit3.Text := '88.123.456';

Funktioniert aber nicht, was mache ich da falsch

_________________
Es gibt keine dummen Fragen nur dumme Antworten!!!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 23.06.06 12:28 
Da die 75 als Fix-Text betrachtet wird, muss der übergebene Wert mit 75 anfangen.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 23.06.06 13:51 
Hallo,

oder so:
ausblenden Delphi-Quelltext
1:
2:
MaskEdit1.EditMask := '75.000.000;1;_';  
MaskEdit1.Text := FormatMaskEdit('75.000.000;0;_','123456');

warum mal die 1 in EditMask und die 0 im Argument für FormatMaskEdit, kA :gruebel: weis das Jemand?

Datum-Zeit:
ausblenden Delphi-Quelltext
1:
2:
MaskEdit1.EditMask := '99/99/0000 !90:00;1;_';  
MaskEdit1.Text := FormatMaskEdit('99/99/0000 !90:00;0;_','121220061500');

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )