SearchForVirtualItemEventArgs 类     
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为 SearchForVirtualItem 事件提供数据。
public ref class SearchForVirtualItemEventArgs : EventArgs
	public class SearchForVirtualItemEventArgs : EventArgs
	type SearchForVirtualItemEventArgs = class
    inherit EventArgs
	Public Class SearchForVirtualItemEventArgs
Inherits EventArgs
		- 继承
 
示例
下面的代码示例演示了此类型的用法。 在此示例中,事件处理程序报告事件的发生情况 SearchForVirtualItem 。 此报表可帮助你了解事件发生的时间,并可以帮助你进行调试。 若要报告多个事件或频繁发生的事件,请考虑将 Show 替换为 Console.WriteLine 或将消息追加到多行 TextBox。
若要运行示例代码,请将其粘贴到包含名为 ListView1的 类型的ListView实例的项目中。 然后,确保事件处理程序与 SearchForVirtualItem 事件相关联。
private void ListView1_SearchForVirtualItem(Object sender, SearchForVirtualItemEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "IsTextSearch", e.IsTextSearch );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "IncludeSubItemsInSearch", e.IncludeSubItemsInSearch );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Index", e.Index );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "IsPrefixSearch", e.IsPrefixSearch );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Text", e.Text );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "StartingPoint", e.StartingPoint );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Direction", e.Direction );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "StartIndex", e.StartIndex );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "SearchForVirtualItem Event" );
}
Private Sub ListView1_SearchForVirtualItem(sender as Object, e as SearchForVirtualItemEventArgs) _ 
     Handles ListView1.SearchForVirtualItem
    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "IsTextSearch", e.IsTextSearch)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "IncludeSubItemsInSearch", e.IncludeSubItemsInSearch)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Index", e.Index)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "IsPrefixSearch", e.IsPrefixSearch)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Text", e.Text)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "StartingPoint", e.StartingPoint)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Direction", e.Direction)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "StartIndex", e.StartIndex)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"SearchForVirtualItem Event")
End Sub
	注解
SearchForVirtualItemEventArgs在虚拟模式下对控件调用 FindItemWithText 或 FindNearestItem 方法ListView时,将构造并传递给 SearchForVirtualItem 事件。
构造函数
| SearchForVirtualItemEventArgs(Boolean, Boolean, Boolean, String, Point, SearchDirectionHint, Int32) | 
		 初始化 SearchForVirtualItemEventArgs 类的新实例。  | 
        	
属性
| Direction | 
		 获取自当前项应执行搜索的方向。  | 
        	
| IncludeSubItemsInSearch | 
		 获取一个值,该值指示搜索是否应包括列表项的子项。  | 
        	
| Index | 
		 获取或设置 ListViewItem 中找到的 ListView 的索引。  | 
        	
| IsPrefixSearch | 
		 获取一个值,该值指示搜索是否应返回项文本以搜索文本开头的项。  | 
        	
| IsTextSearch | 
		 获取一个值,该值指示搜索是否为文本搜索。  | 
        	
| StartIndex | 
		 获取搜索起始处的 ListViewItem 的索引。  | 
        	
| StartingPoint | 
		 获取搜索的起始位置。  | 
        	
| Text | 
		 获取用于在 ListView 控件中查找项的文本。  | 
        	
方法
| Equals(Object) | 
		 确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
		 作为默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
		 获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
		 创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 返回表示当前对象的字符串。 (继承自 Object) |