Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   C# C# / Combox und LoadFromFile (https://www.delphipraxis.net/54052-c-combox-und-loadfromfile.html)

Jens Schumann 27. Sep 2005 08:34


C# / Combox und LoadFromFile
 
Hallo,
gibt es unter C# ein Äquivalent zu TComboBox.Items.LoadFromFile?
Ich möchte gerne die Items einer Combox aus einer Datei laden.
Leider haben die Items einer Combox aus dem .NET Framework keine
LoadFromFile Methode.

Z.Z habe ich es so gelöst:
Code:
string Line
StreamReader sr = new StreamReader(Filename);
while ((Line = sr.ReadLine()) != null)
  cb.Items.Add(Line);
Halte ich für ziemlich umständlich.
Gibt es eine elegantere Methode?


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:20 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