Hi
I'm trying to loop through the items in a listbox (files in a directory).
I've tried using the code/suggestions from another discusion
,but keep on getting the following error.
any suggestions?
Thanks
Gert
I'm trying to loop through the items in a listbox (files in a directory).
I've tried using the code/suggestions from another discusion
"ListBox items accept objects of any type as elements. Find where the
elements are being added, and use that class in the foreach. For instance,
if you do this
listBox1.Items. Add(new MyCustomClass(" Hi", 3, true));
then you would do this to get the values
foreach (MyCustomClass item in listBox1.Items) {
} "
elements are being added, and use that class in the foreach. For instance,
if you do this
listBox1.Items. Add(new MyCustomClass(" Hi", 3, true));
then you would do this to get the values
foreach (MyCustomClass item in listBox1.Items) {
} "
"Error 1 foreach statement cannot operate on variables of type 'System.Windows .Forms.CheckedL istBox' because 'System.Windows .Forms.CheckedL istBox' does not contain a public definition for 'GetEnumerator' C:\Users\gerts\ Documents\Visua l Studio 2005\Projects\D irTest2\DirTest 2\Form1.cs 341 13 DirTest2
"
"
Thanks
Gert
Comment