Einzelnen Beitrag anzeigen

HolgerCW

Registriert seit: 28. Nov 2006
Ort: Marl
1.207 Beiträge
 
Delphi XE7 Enterprise
 
#10

Re: Doppelte Einträge in 5 ComboBoxen herausfinden ?

  Alt 14. Dez 2007, 12:57
Super danke,

habe das jetz mit FindComponent gelöst:

Delphi-Quellcode:
var
 I, T: Integer;
 CB1, CB2: TComboBox;
begin

 For I := 1 to 5 do
 begin

  For T := 1 to 5 do
  begin

   CB1 := TComboBox(Form_Sigma_Auftrag.FindComponent('CB_Auftragstyp_' + IntToStr(I)));
   CB2 := TComboBox(Form_Sigma_Auftrag.FindComponent('CB_Auftragstyp_' + IntToStr(T)));

   If (CB1.Text = CB2.Text) AND (I <> T) AND (CB1.Text <> '') AND (CB2.Text <> '') then
   begin

    Application.MessageBox(PChar('Der Auftragstyp ' + CB1.Text + ' ist doppelt vorhanden.'),'Kritischer Fehler',MB_OK or MB_ICONSTOP);
    exit;

   end;

  end;

 end;
Gruss

Holger
  Mit Zitat antworten Zitat