Thema: Delphi String Cols auslesen

Einzelnen Beitrag anzeigen

Benutzerbild von Die Muhkuh
Die Muhkuh

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

Re: String Cols auslesen

  Alt 27. Mär 2008, 00:48
Delphi-Quellcode:
procedure StringGridColsToComboBox(StringGrid: TStringGrid; ComboBox: TComboBox; Col: Integer);
var
  I: Integer;
begin
  ComboBox.Items.BeginUpdate;
  ComboBox.Items.Clear;

  for I := StringGrid.FixedRows to StringGrid.RowCount - 1 do
    ComboBox.Items.Add(StringGrid.Cells[Col, I]);

  ComboBox.Items.EndUpdate;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  StringGridColsToComboBox(StringGrid1, ComboBox1, 0);
end;
Ach gemein, ich geb zu, dass vom Christian ist viel schöner...
  Mit Zitat antworten Zitat