问题描述
我正在尝试剪掉 TableLayoutPanel 中的一些文本。
这是我用来打印 TableLayoutPanel 的代码:
Dim sf = New StringFormat()
For Each ctrl As Control In TableLayoutPanel.Controls
sf.Alignment = If(TableLayoutPanel.GetColumn(ctrl) < 2,Stringalignment.Near,Stringalignment.Far)
e.Graphics.DrawString(ctrl.Text,ctrl.Font,Brushes.Black,Panel.PointToClient(TableLayoutPanel.PointToScreen(ctrl.Bounds.Location)),sf)
Next
我已经研究了几个小时,但我似乎做对了。
TableLayoutPanel 内的标签具有属性,Autosize = false 和 Width = 100。
但 DrawString 对它没有任何作用。
我也看过sf。 options sf.Trimming = StringTrimming.EllipsisWord 和 e.Graphics.MeasureString 选项,但没有任何效果。
有人可以给我举个例子如何处理这个问题吗? 感谢您的时间!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)