ListViewVirtualItemsSelectionRangeChangedEventArgs 类

定义

VirtualItemsSelectionRangeChanged 事件提供数据。Provides data for the VirtualItemsSelectionRangeChanged event.

public ref class ListViewVirtualItemsSelectionRangeChangedEventArgs : EventArgs
public class ListViewVirtualItemsSelectionRangeChangedEventArgs : EventArgs
type ListViewVirtualItemsSelectionRangeChangedEventArgs = class
    inherit EventArgs
Public Class ListViewVirtualItemsSelectionRangeChangedEventArgs
Inherits EventArgs
继承
ListViewVirtualItemsSelectionRangeChangedEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example demonstrates the use of this type. 在此示例中,事件处理程序报告 @no__t 的事件发生。In the example, an event handler reports on the occurrence of the VirtualItemsSelectionRangeChanged event. 此报表可帮助你了解何时发生事件,并可帮助你进行调试。This report helps you to learn when the event occurs and can assist you in debugging. 若要报告多个事件或频繁发生的事件,请考虑将 @no__t 0 替换为 Console.WriteLine,或将消息附加到多行 TextBoxTo report on multiple events or on events that occur frequently, consider replacing Show with Console.WriteLine or appending the message to a multiline TextBox.

若要运行示例代码,请将其粘贴到包含名为 @no__t ListView 类型实例的项目中。To run the example code, paste it into a project that contains an instance of type ListView named ListView1. 然后,确保事件处理程序与 @no__t 0 事件关联。Then ensure that the event handler is associated with the VirtualItemsSelectionRangeChanged event.

private void ListView1_VirtualItemsSelectionRangeChanged(Object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "EndIndex", e.EndIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "IsSelected", e.IsSelected );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "StartIndex", e.StartIndex );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "VirtualItemsSelectionRangeChanged Event" );
}
Private Sub ListView1_VirtualItemsSelectionRangeChanged(sender as Object, e as ListViewVirtualItemsSelectionRangeChangedEventArgs) _ 
     Handles ListView1.VirtualItemsSelectionRangeChanged

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "EndIndex", e.EndIndex)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "IsSelected", e.IsSelected)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "StartIndex", e.StartIndex)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"VirtualItemsSelectionRangeChanged Event")

End Sub

注解

当 @no__t 为虚拟模式,并且更改项范围的选定状态时,将发生 @no__t 0 事件。The VirtualItemsSelectionRangeChanged event occurs when the ListView is in virtual mode, and the selection state of a range of items is changed.

构造函数

ListViewVirtualItemsSelectionRangeChangedEventArgs(Int32, Int32, Boolean)

初始化 ListViewVirtualItemsSelectionRangeChangedEventArgs 类的新实例。Initializes a new instance of the ListViewVirtualItemsSelectionRangeChangedEventArgs class.

属性

EndIndex

获取项范围中更改了选择状态的最后一项的索引。Gets the index for the last item in the range of items whose selection state has changed.

IsSelected

获取一个值,该值指示是否已选定范围中的项。Gets a value indicating whether the range of items is selected.

StartIndex

获取范围中更改了选择状态的第一项的索引。Gets the index for the first item in the range of items whose selection state has changed.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于