0

I want to make a sudoku field of labels, for which I have the code. Now I want thick lines between some labels so you can see which block of labels are together.

This code makes the labels:

const int spacing = 30;  //ruimte tussen kotjes
            int aantal = (int)nudColsPerBlock.Value * (int)nudRowsPerBlock.Value; //totaal aantal kotjes per rij/kolom
            Label[][] SudokuRaster = new Label[aantal][];
            for (int x = 0; x < aantal; x++)
            {
                SudokuRaster[x] = new Label[aantal];
                for (int y = 0; y < aantal; y++)
                {
                    SudokuRaster[x][y] = new Label();
                    SudokuRaster[x][y].BorderStyle = BorderStyle.FixedSingle;
                    SudokuRaster[x][y].Location = new System.Drawing.Point(x * spacing, y * spacing);
                    SudokuRaster[x][y].Name = "Sudoku" + x.ToString() + "," + y.ToString();
                    SudokuRaster[x][y].Size = new Size(spacing, spacing);
                    SudokuRaster[x][y].TabIndex = 0;
                    SudokuRaster[x][y].MouseClick += new System.Windows.Forms.MouseEventHandler(this.MouseClick);

                }
                this.Controls.AddRange(SudokuRaster[x]);
            }
Corey Ogburn
  • 24,072
  • 31
  • 113
  • 188
Louisdj
  • 13
  • 5
  • Just in care you're interested, [here](http://stackoverflow.com/a/15344546/643085) is my example of a Sudoku board using current .Net Desktop UI technologies. – Federico Berasategui Apr 30 '13 at 17:46
  • Either draw lines in the Paint() event of the container for the Labels, or add other Labels that have no text and a height of two to act as lines. – Idle_Mind Apr 30 '13 at 18:57

0 Answers0