How to remove object from List Collection
So i have a List of a custom object class so the code looks as follow
var itemList = new List<Item>();
so for my Item its really just a simple class it only inherits defaults,
and only has 3 private fields called
private double Price;
private string @Url;
private string Name;
public double setPrice(string price)
{
this.Price = price;
}
and similar for accessor methods. Now The list of items is for a windows
form project that stores Item info. Now i have 2 questions,
One. How can I remove an Item from the list? Two. How can I access the
itemList variable from a seperate windows form within the same project.
Example when hitting edit a new window pops up creating a seperate windows
form but how can i make the edit window be able to use the itemList
variable?
No comments:
Post a Comment