Search code examples
.netlistboxdelphi-prismlistboxitems

Is there ListBox loadfromfile method equivalent in .NET?


I would like to use ListBox1.loadfromfile method in .NET, but it doesn't seem to exists or have anything equivalent to that method. I have searched on MSDN library site and I came empty handed. Is there a equivalent method in .NET?

Thanks in advance,


Solution

  • This can get you close:

    listBox1.Items.AddRange(File.ReadAllLines(@"c:\test.txt"));