在尝试将表格单元中的标签从左上角移动到单元格中心时,我尝试使用添加填充和/或边距的方法进行实验。
然而,无论我尝试了什么都没有奏效。以下是我尝试过的代码和结果:
然而,无论我尝试了什么都没有奏效。以下是我尝试过的代码和结果:
// Setting the padding just cuts off the bottom part of the text
//lbl.Padding = new System.Windows.Forms.Padding(1);
// How to set Margin?
//lbl.Margin = new System.Windows.Forms.Margin(1); <- This mimics "Padding" but is not recognized
//lbl.Margin = new Thickness(6); <- This is the only example I could find, but it's for WPF