With respect; your question shows lack of understanding of the classes you are using; as such, array usage in general and reference to array index. You could also simplify your use of code by using easier methods.
Dictionary, List Of T, Or Array - all of which I will reference links for you to study to identify the errors in your logic, and to demonstrate other methods as alternatives. From there, if you still have questions regarding these links, feel free to reply, and I will be happy to help answer them for you.
List Of T:
http://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1[
^]
Dictionary:
http://www.dotnetperls.com/dictionary[
^] (Best option in my opinion.)
Create a declaration for either of the methods above at class level; example:
namespace Test1C_Sharp
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
int chevyTime = 4;
int fordTime = 2;
Dictionary<int, string> eDiction = new Dictionary<int, string>();
string chevy = "chevy";
string ford = "ford";
private void Main_Load(object sender, EventArgs e)
{
{
eDiction.Add(chevyTime, chevy);
eDiction.Add(fordTime, ford);
docheck();
}
}
private void docheck()
{
}
}
}
While in your first loop: Adding chevy and the time to a list. You can then add the same key/values from the first for statement to your list. And do the same for the for ford statement too....
In the third and forth for statements, you can then access your list/dictionary by iterating and checking the keys and values. Thus giving you access to the values of the first for statement.
Your logic needs some touching up.
How are you changing the times?
If you rethink your logic from your first four declarations, you could do this from with-in one for statement using the links I gave you.
If you do not wish to do this any other way, you will need to read up on the array class:
http://msdn.microsoft.com/en-us/library/system.array%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1[
^] for a better understanding of the basics and how to achieve this.
Personally, I think you should rewrite your logic from scratch once you've read the documents I provided. I hope this answer was helpful to you and if there is something you don't understand, let me know if you have any other questions.