Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Alle DBCombobox Einträge in DBText anzeigen (https://www.delphipraxis.net/40929-alle-dbcombobox-eintraege-dbtext-anzeigen.html)

Grolle 23. Feb 2005 11:18


Alle DBCombobox Einträge in DBText anzeigen
 
Hallo!
Wie kann ich mir alle Einträge einer DBCombobox
in einem DBTextfeld anzeigen lassen? Wenn ich
Datasource und Datafield einstelle zeigt er mir
natürlich nur einen Eintrag an.

Sharky 23. Feb 2005 11:29

Re: Alle DBCombobox Einträge in DBText anzeigen
 
Hai Grolle,

die Einträge einer DBCombobox stehen doch alle in den Items oder bin ich da total daneben heute?

Quake 23. Feb 2005 11:31

Re: Alle DBCombobox Einträge in DBText anzeigen
 
Meinst du evtl. DBComboBox.Items.Text ???

[edit]Menno Sharky wieder mal schneller :thumb: [/edit]

Grolle 23. Feb 2005 11:52

Re: Alle DBCombobox Einträge in DBText anzeigen
 
Hallo!
Danke für eure Antworten. Leider bringt mich das nicht weiter.
Ich suche einfach nur eine Möglichkeit, wie ich mir alle
Items einer DBCombobox anzeigen lassen kann. Egal, ob in einem
Label, Listbox..... Wenn ich DBCombobox.Items.Text einer Listbox
zuordne bekomme ich immer den Fehler inkompatible Typen (TStrings
und String).
:(

Sharky 23. Feb 2005 12:00

Re: Alle DBCombobox Einträge in DBText anzeigen
 
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
  ListBox1.Items := DBComboBox1.Items;
end;

Grolle 23. Feb 2005 12:05

Re: Alle DBCombobox Einträge in DBText anzeigen
 
Hätte ich das Text mal weggelassen.
Danke!!!

Quake 23. Feb 2005 13:44

Re: Alle DBCombobox Einträge in DBText anzeigen
 
Bei ".Text" bekommst du ebend alle Einträge in einem String zurück. Wobei alle Einzellenen einträge mit Carridge Return voneinander getrennt sind. Also je nach dem was du als Ergebnis brauchst mit ".Text" oder ohne.

Was genauso gut funktioniert ist:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
  ListBox1.Items.Text := DBComboBox1.Items.Text;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:09 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz