作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在尝试让 TableLayoutPanel 中的一些标签从其单元格的左上角移动到单元格的中心时,我正在尝试添加填充和/或边距。
但是,我尝试过的任何东西都不起作用。这是我尝试过的代码和结果:
// 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
最佳答案
尝试:
lbl.Margin = new Padding(1);
你可能还想做:
lbl.Dock = DockStyle.Fill;
lbl.TextAlign = ContentAlignment.MiddleCenter;
lbl.AutoSize = false;
关于c# - 以编程方式为标签分配边距和/或填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10390904/
在 Rails 中,您可以使用嵌套路由为 has_one 和 has_many 关系创建 RESTful 路由。可以在 Rails Guides 上找到示例 请问有没有什么好的方法可以为habtm关系
我是一名优秀的程序员,十分优秀!