I have a listbox where the items are a struct. This struct contains two strings. One for the title, and the other one for plain text. Now i want to change the text in a existing item in the listbox. Is there a way to do this without removing the existing and adding the updated version to the list?
This is what i want to do,
((TextItemRecord) listbox1.Items[myListbox1.BeforeIndex]).text = "Blablabla";
The compiler says, "Cannot modify the result of an unboxing conversion" when i try to do this. Any solutions?
Struct,
struct TextItemRecord
{
public UInt64 address;
public string name, text;
public TextItemRecord(UInt64 address, string name)
{
this.address = address;
this.name = name;
this.text = "";
}
public override string ToString()
{
return name;
}
}
I'm sorry folks, I have no idea how this site is supposed to work