![]() |
String Cols auslesen
Hallo,
wie kann ich alle Einträge der ersten Spalte (nicht Zeile) eines Stringgrids in einer Combobox anzeigen? Gruss Aaron |
Re: String Cols auslesen
Moin Aaron,
z.B. so:
Delphi-Quellcode:
ComboBox.Items.AddStrings(StringGrid.Cols[0]);
|
Re: String Cols auslesen
Delphi-Quellcode:
Ach gemein, ich geb zu, dass vom Christian ist viel schöner...
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; |
Re: String Cols auslesen
Hallo,
vielen Dank. Was hab ich alles getestet, und ich sag jetzt nicht wie lange. :-) Aaron |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz