Set up the method with a parameter:
Code:
private void MyMethod(int index)
{
MessageBox.Show("The index is " + index.ToString());
}
As you can see, you can then access the variable within the method. To use the method:
- this uses the index 6 to pass to the method.