private static void DrawHorizontalHeader(Graphics g, DataMatrix dataMatrix, DataMatrix solutionMatrix) { g.FillRectangle(HeaderBackground, g.ClipBounds); for (short i = 0; i < solutionMatrix.Width; i++) { short j = Constants.HEADER_SIZING / 20; foreach (CellsBlock block in MatrixManager.GetLineHeaders(dataMatrix, solutionMatrix, null, i)) { PointF point = new PointF(i * Constants.CELL_SIDE, (j - 1) * 20); j--; DrawBlockCounter(g, block, point); } g.DrawString((i + 1).ToString(), HeaderFont, Brushes.Blue, new PointF(i * Constants.CELL_SIDE, 3)); g.DrawLine(GetGridPen(i), i * Constants.CELL_SIDE, 0, i * Constants.CELL_SIDE, Constants.HEADER_SIZING); } }