1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| protected void OnPaint(PaintEventArgs e) {
string[,] matrix = { { "1", "2", "3" }, { "4", "5", "6" }, { "7", "8", "9" } };
for (int y = 0; y < matrix.GetLength(0); y++) { for (int x = 0; x < matrix.GetLength(1); x++) { FontFamily font = new FontFamily("Arial"); Font points = new Font(font, 30, FontStyle.Regular, GraphicsUnit.Pixel);
rect.X += 25; e.Graphics.DrawString(matrix[y, x].ToString(), points, new SolidBrush(Color.Black), rect); }
rect.X = 10; rect.Y += 25; } } |