Autor Beitrag
NTM
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120

Win XP
2005 Prof
BeitragVerfasst: Do 10.08.06 15:01 
Hallo zusammen,
ich habe mal wieder ein kleines Problem. Ich habe mehrere DBEdit´s auf meiner Seite plaziert nun möchte ich wenn ich auf Sichern drücke das er nochmal alle Felder in einem MessageDlG anzeigt.

Danke schon einmal im vorraus für eure Hilfe.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 11.08.06 08:01 
meinst du sowas:

ShowMessage(dbedit1.text) :?:
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Fr 11.08.06 11:58 
user profile iconMiri hat folgendes geschrieben:
meinst du sowas:

ShowMessage(dbedit1.text) :?:

Nee, damit zeigt es ja NUR EINEN Wert an ;-)

Lösungsvorschlag:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure Sichern;
var  i: Integer;
     s: String;  //MeldungsText
begin
  s:= '';
  //--alle Controls durchlaufen
  for i := 0 to xyz.ControlCount -1 do
    if xyz.Controls[i] is TDBEdit then
        //--DBEditWerte in extra Zeile
        s := s + TDBEdit(xyz.Controls[i]).Text + #13;
  //--MessageDialogBox erstellen
  if MessageDlg(s + 'alles okay?', mtInformation, [mbYes, mbNo], 0) = mrOk then
    ...{Speichern}
  else
   ... {zurück zur Eingabe}
end;

xyz ist die Komponente auf dem die DBEdits liegen, beispielsweise ein Panel oder eine GroupBox...
Der MessageText s enthält alle Werte aus den gefundenen DBEdits, jeweils in einer eigenen Zeile ...
NTM Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120

Win XP
2005 Prof
BeitragVerfasst: Mo 14.08.06 07:30 
Danke genau das habe ich Gesucht!.