Hi i'm trying to use the tag item of a listbox.
heres my code.
int number = 0;
foreach (ListViewItem item in listBox1.Items)
{
Tag tag = (Tag) item.Tag;
saveSlide(showid, tag.photoid, enumber);
number++;
}
problem im havin is when i run the program i get an error message sayin cannot convert type string to system.ListView but i haven't declared item as a string anywher in my program
This is where i add the items to the listbox. Please help. Im on a dead line and have sooo much more to do
private void buttonAdd_Click(object sender, EventArgs e)
{
//add selected item into listBox
DataRowView drv = (DataRowView)listBox1.SelectedItem;
Tag tag = new Tag();
string title = drv["title"].ToString();
ListViewItem item = new ListViewItem(title);
item.Tag = tag;
tag.photoid = (int)drv["photoid"];
listBox1.Items.Add(title);
}