2

是否可以增加 VB.Net 中 CheckedListBox 中项目之间的空间?如何?

4

1 回答 1

0

取决于间距的含义。如果它是水平的,则使用“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
于 2013-10-10T00:18:48.427 回答