SearchForVirtualItemEventArgs Classe

Définition

Fournit des données pour l'événement SearchForVirtualItem.

public ref class SearchForVirtualItemEventArgs : EventArgs
public class SearchForVirtualItemEventArgs : EventArgs
type SearchForVirtualItemEventArgs = class
    inherit EventArgs
Public Class SearchForVirtualItemEventArgs
Inherits EventArgs
Héritage
SearchForVirtualItemEventArgs

Exemples

L’exemple de code suivant illustre l’utilisation de ce type. Dans l’exemple, un gestionnaire d’événements signale l’occurrence de l’événement SearchForVirtualItem . Ce rapport vous aide à apprendre quand l’événement se produit et peut vous aider à déboguer. Pour signaler plusieurs événements ou événements qui se produisent fréquemment, envisagez de ShowConsole.WriteLine remplacer ou d’ajouter le message à un multiligne TextBox.

Pour exécuter l’exemple de code, collez-le dans un projet qui contient une instance de type ListView nommée ListView1. Vérifiez ensuite que le gestionnaire d’événements est associé à l’événement 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

Remarques

L’objet SearchForVirtualItemEventArgs est construit et transmis à l’événement SearchForVirtualItem lorsque vous appelez le ou FindItemWithText les FindNearestItem méthodes sur un ListView contrôle en mode virtuel.

Constructeurs

Nom Description
SearchForVirtualItemEventArgs(Boolean, Boolean, Boolean, String, Point, SearchDirectionHint, Int32)

Initialise une nouvelle instance de la classe SearchForVirtualItemEventArgs.

Propriétés

Nom Description
Direction

Obtient la direction de l’élément actuel que la recherche doit avoir lieu.

IncludeSubItemsInSearch

Obtient une valeur indiquant si la recherche doit inclure des sous-éléments de liste.

Index

Obtient ou définit l’index du ListViewItem fichier trouvé dans le ListView .

IsPrefixSearch

Obtient une valeur indiquant si la recherche doit retourner un élément si son texte commence par le texte de recherche.

IsTextSearch

Obtient une valeur indiquant si la recherche est une recherche de texte.

StartIndex

Obtient l’index de l’emplacement ListViewItem de démarrage de la recherche.

StartingPoint

Obtient l’emplacement de départ de la recherche.

Text

Obtient le texte utilisé pour rechercher un élément dans le ListView contrôle.

Méthodes

Nom Description
Equals(Object)

Détermine si l’objet spécifié est égal à l’objet actuel.

(Hérité de Object)
GetHashCode()

Sert de fonction de hachage par défaut.

(Hérité de Object)
GetType()

Obtient la Type de l’instance actuelle.

(Hérité de Object)
MemberwiseClone()

Crée une copie superficielle du Objectactuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l’objet actuel.

(Hérité de Object)

S’applique à