How do I add a new item
from a TextBox and Button on a Windows Form at the end of an ArrayList
which references a class?
private product[] value = new product[4];
value[1] = new product("One",5)
value[2] = new product("Two",3)
value[3] = new product("Three",8)
Workflow
- Enter new products details into
textbox1
,textbox2
,textbox3
When I click
Add
the new product gets added to the array:value[1] = new product("One",5)
value[2] = new product("Two",3)
value[3] = new product("Three",8)
value[4] = new product("Four",2)
What is the code for doing this?