ListView.RedrawItems(Int32, Int32, Boolean) Method

Definition

强制重新绘制某个范围内的 ListViewItemForces a range of ListViewItem objects to be redrawn.

public:
 void RedrawItems(int startIndex, int endIndex, bool invalidateOnly);
public void RedrawItems (int startIndex, int endIndex, bool invalidateOnly);
member this.RedrawItems : int * int * bool -> unit
Public Sub RedrawItems (startIndex As Integer, endIndex As Integer, invalidateOnly As Boolean)

Parameters

startIndex
Int32

要重新绘制的范围中第一个项的索引。The index for the first item in the range to be redrawn.

endIndex
Int32

要重新绘制的范围中最后一个项的索引。The index for the last item of the range to be redrawn.

invalidateOnly
Boolean

若为 true,则使项的范围无效;若为 false,则使项无效并重新绘制项。true to invalidate the range of items; false to invalidate and repaint the items.

Exceptions

startIndexendIndex 小于 0,大于或等于 ListView 中的项数;或者对于虚拟模式,大于 VirtualListSize 的值。startIndex or endIndex is less than 0, greater than or equal to the number of items in the ListView or, if in virtual mode, greater than the value of VirtualListSize.

-或--or- 给定的 startIndex 大于 endIndex.The given startIndex is greater than the endIndex.

Remarks

无论 ListView 处于虚拟模式还是常规模式下,都可以使用 RedrawItems 方法。The RedrawItems method can be used whether the ListView is in virtual mode or regular mode.

如果在调用 RedrawItems之前已调用 BeginUpdate 方法,则不会进行重绘。If the BeginUpdate method has been called prior to the call to RedrawItems, the redraw will not occur.

Applies to