I can't figure out why I'm getting the out of range exception on the following piece of code. The values for _maxRowIndex and _maxColIndex are 5, and 0 respectively. The exception is being thrown on the first time through when row and col are both equal to 0. I don't understand why 0, 0 would be out of bounds on the array.
_cells = new ToolBarButton[_maxRowIndex, _maxColIndex];
.
.
.
for (int col = 0; col <= _maxColIndex; col++) {
for (int row = 0; row <= _maxRowIndex; row++)
{
if (_cells[row, col] == null)
{
PopulateCell(toolBarbutton, row, col);
}
}
}