Button[] btnArr = new Button[COUNT]; //count is the amount of buttons this array can hold.
//Add/Change a button:
btnArr[indx] = IAmButton; //indx is the position, IAmButton is the button you are adding.
//Get a button:
IAmButton = btnArr[indx];
//Get a specific button. Not so sure about this one...
TempButton = btnArr.Controls.Find(name); //name is a string, that you named the button you looking for.

Ok. Now that method was for windows forms. Depending on what your project is and what this code you are applying to the buttons is for, a WPF application might make that process a bit more clean and managable.

Okay, then if I can assume that the buttons already exist on the form, then simply have all the buttons point to the same event handler, and examine the object sender to determine which button was pressed.

Button btn = sender as Button;
Now btn is the button thas was pressed, and you can take whatever action you want on it.

If the button has a payload in the Tag property you can use that to determine how to send &*^%$ to the other PC.

Summary: The form contains the array of buttons, they all can share the same event handler, and perform actions based on some criteria of the button properties.

You helped me too, thanks a lot!
I'm a bit newbie in C# and I took it as a optional course at my college. Now I have to make a program instead of exam and I find it difficult. My teacher is great but I'm afraid to ask him for help because I'm in a beginning of a project, and he will be disappointed. So I will ask you a number of stupid questions :) :)
Where do I add this button array, I mean where do I put the code?
Into Form or into Program class that automatically generates??
Thanks

Thank you very much.:) I put it in Form1_Load region, and I have multidimensional array (like 5x5 matrix), but I can't add buttons on the form, if I use Controls.Add it adds only one button, and if i use Controls.AddRange program gives me an error :'(

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...