基本上我遇到了删除tablelayoutpanel中控件之间的填充/边距的问题.
我已将tablelayoutpanel边距和填充设置为0. Cellborderstyle为none.
对于边距和填充,添加的控件都设置为0.
然而,这种神秘的边缘不断出现.有帮助吗?
在这里尝试了这两个解决方案和网上的其他各种解决方案,但没有一个可以消除它们之间的间距
在VS2010上运行.net 4.5
Form1.cs的
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Multiply {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
LoadBoard(10, 10);
}
private void LoadBoard(int col, int row) {
board.ColumnCount = col;
board.RowCount = row;
board.BorderStyle = BorderStyle.FixedSingle;
float colSize = 100f / col;
float rowSize = 100f / row;
board.ColumnStyles[0].SizeType = SizeType.Percent;
board.ColumnStyles[0].Width = colSize; …Run Code Online (Sandbox Code Playgroud)