Einzelnen Beitrag anzeigen

Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#8

Re: Doppelte Einträge in 5 ComboBoxen herausfinden ?

  Alt 14. Dez 2007, 12:45
Hi,

wenn Du z.B. den Text einer ComboBox abfragen willst, könntest Du es z.B. so machen:

Delphi-Quellcode:
var
  I: Integer;
  J: Integer;
  cbb_comp1, cbb_comp2: TComboBox;
begin
  for I := 0 to Self.ComponentCount - 1 do
  begin
    if Self.Components[I] is TComboBox then
    begin
      cbb_comp1 := (Self.Components[I] as TComboBox);

      for J := 0 to Self.ComponentCount - 1 do
      begin
        if Self.Components[J] is TComboBox then
        begin
          cbb_comp2 := (Self.Components[J] as TComboBox);

          if cbb_comp1 <> cbb_comp2 then
          begin
            if cbb_comp1.Text = cbb_comp2.Text then
            begin
              ShowMessage(cbb_comp1.Name + ' und ' + cbb_comp2.Name +
                ' sind gleich');
            end;
          end;
        end;
      end;
    end;
  end;
end;
  Mit Zitat antworten Zitat