Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello every1!! :D
OK, I need help here...I have a ListBox with View.Details and 4 columns, and I need to retrieve all of the items in it and then save them to an INI file...
I tried ListView.GetItemAt() but then I realized that the X and Y coordinates were the SCREEN coordinates, and not the rows/columns in the ListBox...
How can I get these items??
Can anybody please help me??
Thanx!! ;)El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Ah you are actually using a list view not a list box:
System.IO.TextWriter wr = System.IO.File.CreateText("text.ini");
for(int t=0;t<ListView1.Items.Count;t++)
{
string aline = ListView1.Items[t].Text + ","; // comma delimited
for(int s=1;s<ListView1.Items[t].SubItems.Count;s++)
{
aline += ListView1.Items[t].SubItems[s].Text + ",";// comma deliminted
}
aline = aline.SubString(0,aline.Length-1); // remove trailing comma
wr.WriteLine(aline);
}wr.Flush();
wr.Close();Hope this helps some,
Chi
They mostly come at night...mostly

YES!!
It worked!! thanx!! ;) (and yes, it was ListView... :P )
But now, if it doesn't bother, can you tell me 3 more things about ListViews??1. What's the ListView property that arranges the items when you click on a column?? or do I have to do it manually??
2. Is there an automated way so that when the user deletes an item from a ListView, the next one replaces the one deleted, etc...
3. How do I do it so like when a user clicks 2 times on a ListView item, it becomes writable?? it does it fine on the first item, but not on its sub items...
Much thanx!! ;)
El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |