|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace Jacobi_RedBlack.CustomControls
{
public partial class Grid : UserControl
{
public Grid()
{
InitializeComponent();
for (int x = 0; x < Constants.gridCellsPerRow; x++)
{
for (int y = 0; y < Constants.gridCellsPerCol; y++)
{
gridCell[x, y] = new CustomControls.GridCell();
if (x == 0 || x == Constants.gridCellsPerRow - 1 || y == 0 || y == Constants.gridCellsPerCol-1)
{
this.groupBox.Controls.Add(this.gridCell[x, y]);
this.gridCell[x, y].Size = new System.Drawing.Size(26, 20);
this.gridCell[x, y].TabIndex = x + y;
this.gridCell[x, y].Location = new System.Drawing.Point(x * Constants.gridCellOffsetMul + Constants.gridCellOffsetAdd, y * Constants.gridCellOffsetMul + Constants.gridCellOffsetAdd);
if ((y > 0 && x == 0 && y < Constants.gridCellsPerCol - 1) || (y > 0 && x == Constants.gridCellsPerRow - 1 && y < Constants.gridCellsPerCol - 1))
{
this.gridCell[x, y].CellValue.Text = "0";
}
}
}
}
}
private void gridCell3_Load(object sender, EventArgs e)
{
}
private void gridCell00_Load(object sender, EventArgs e)
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
coding in C# C++ C
==============================================
Code in English, not Gibberish