Click here to Skip to main content
15,915,032 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to add values to an array one after the other under button click...I want to add items to the zeroth index and then the first index based on button click....
Posted

1 solution

Keep a class level counter and increment it.

For e.g.
int arrayCount = 0;

private void button_Click(sender s, event e)
{
  sum += myArray[arrayCount++];
}
 
Share this answer
 
Comments
Korathu 2 15-Apr-13 3:27am    
add array indices one after other to string array under button click i mean..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900