I følgende kode prøver jeg at tage indholdet af btnArray der ikke er NULL og kopiere det til tempArray. For derefter at genarrangere det i btnArray.
Jeg får dog følgende exception
"Specified argument was out of the range of valid values."
"Parameter name: Index was out of range. Must be non-negative and less than the size of the collection."
og jeg kan ikke helt se hvor det er, det går galt.. måske er det bare mit overblik der mangler

private void CopyArray()
{
try
{
if(btnArray.Count > 0)
{
int iCounter = 0;
for (int iButtonIndex = btnArray.Count; iButtonIndex > 0; iButtonIndex--)
{
if (btnArray[iButtonIndex-1] != null)
{
tempArray[iCounter] = btnArray[iButtonIndex-1];
iCounter++;
}
}
for (int iButtonIndex = 0; iButtonIndex < tempArray.Count; iButtonIndex++)
{
btnArray[iButtonIndex] = tempArray[iButtonIndex];
}
}
else
{
MessageBox.Show("(COPY) ARRAY IS EMPTY");
}
}
catch(Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1);
}
}