I am trying to cast the CheckedListBox.CheckedItems[i] to a struct. Here is some of my code.
string name = ((customer)checkedListBox1.CheckedItems[i]).name;
customer is defined as follows:
private struct customer
{
public string number;
public string name;
public override string ToString()
{
return this.number + "\t-- " + this.name;
}
}
The compile tells me that it is an invalid cast.