是否可以增加VB.Net中CheckedListBox中项目之间的空间?怎么样?
答案 0 :(得分:0)
取决于间距的含义。如果是Horizontal,则使用“ColumnWidth”。如果你想要垂直间距,那么你必须继承控件并取消隐藏棘手的“ItemHeight”属性(见下文)。它很棘手,如果IntergralHeight设置为TRUE,它会改变整个控件的高度。
Public Class CLB2
Inherits CheckedListBox
Protected _ItemHeight As Integer = 17
<Browsable(True), EditorBrowsable(EditorBrowsableState.Always), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)>
Public Overrides Property ItemHeight As Integer
Get
Return _ItemHeight
End Get
Set(ByVal value As Integer)
_ItemHeight = value
Me.ColumnWidth += 1 'Force an immediate Update
Me.ColumnWidth -= 1
End Set
End Property
End Class