[英]Draw tick border around group of cells (TableLayoutPanel C#)
I'm making a sudoku field in a windows form application (c#) 我在Windows窗体应用程序(C#)中创建数独字段
I've used a TableLayout to make my boxes to put labels in for the numbers displayed in the sudoku, now I need a thick border around every group of 3x3 cells (like a sudoku)... 我已经使用TableLayout制作框来为数独中显示的数字添加标签,现在我需要在每组3x3单元格(如数独)周围加粗边框...
I'm trying with the CellPaint object but I can't set a border around a group of borders... 我正在尝试使用CellPaint对象,但无法在一组边界周围设置边界...
您可以尝试将面板添加到左上角的单元格,并将其RowSpan和ColSpan设置为3。之后,您可以在其上绘制任何边框。
Step 1 第1步
Step 2 第2步
Here is a sample, left is UserControl1, right is UserControl2 with 9x UserControl1 这是一个示例,左为UserControl1,右为UserControl2,带有9x UserControl1
I used padding 4 on the outer sides and padding 2 on the inner sides. 我在外侧使用填充4,在内侧使用填充2。
we had to change our code for making the labels and are doing it this way... 我们必须更改用于制作标签的代码,并以此方式进行操作...
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
But I still need thick borders between some of the labels, any tips? 但是我仍然需要一些标签之间的粗边框,有什么提示吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.