ListView.Scrollable Property

Definition

获取或设置一个值,该值指示在没有足够空间来显示所有项时,是否给滚动条添加控件。Gets or sets a value indicating whether a scroll bar is added to the control when there is not enough room to display all items.

public:
 property bool Scrollable { bool get(); void set(bool value); };
public bool Scrollable { get; set; }
member this.Scrollable : bool with get, set
Public Property Scrollable As Boolean

Property Value

Boolean

如果在需要时给控件添加滚动条,以允许用户查看所有项,则为 true;否则为 falsetrue if scroll bars are added to the control when necessary to allow the user to see all the items; otherwise, false. 默认为 trueThe default is true.

Remarks

如果将此属性设置为 true,则当项数超过控件的工作区大小时,ListView 将显示一个垂直滚动条以供使用。When this property is set to true, the ListView displays a vertical scroll bar to use when the number of items exceeds the size of the client area of the control. 使用此属性可以确保用户可以访问 ListView 控件中的所有可用项。You can use this property to ensure that the user can access all items that are available in the ListView control.

Note

在版本2.0 之前的 .NET Framework.NET Framework 版本中,在将此属性设置为 false 并调整控件的大小时,列标题不会正确绘制。In versions of the .NET Framework.NET Framework prior to version 2.0, the column headers were not painted correctly when setting this property to false and resizing the control to make it larger. 若要解决此问题,请将此属性设置为在 ResizeBegin 事件处理程序中 true,并将其设置回 ResizeEnd 事件处理程序中的 falseTo work around this issue, set this property to true in a ResizeBegin event handler and set it back to false in a ResizeEnd event handler.

Applies to