SearchForVirtualItemEventArgs Klasa

Definicja

Udostępnia dane dla zdarzenia SearchForVirtualItem.

public ref class SearchForVirtualItemEventArgs : EventArgs
public class SearchForVirtualItemEventArgs : EventArgs
type SearchForVirtualItemEventArgs = class
    inherit EventArgs
Public Class SearchForVirtualItemEventArgs
Inherits EventArgs
Dziedziczenie
SearchForVirtualItemEventArgs

Przykłady

W poniższym przykładzie kodu pokazano użycie tego typu. W tym przykładzie program obsługi zdarzeń zgłasza wystąpienie SearchForVirtualItem zdarzenia. Ten raport pomaga dowiedzieć się, kiedy wystąpi zdarzenie, i może pomóc w debugowaniu. Aby zgłosić wiele zdarzeń lub często występujących zdarzeń, rozważ zastąpienie Show komunikatu ciągiem Console.WriteLine lub dołączenie go do wielowierszowego TextBoxelementu .

Aby uruchomić przykładowy kod, wklej go w projekcie zawierającym wystąpienie typu ListView o nazwie ListView1. Następnie upewnij się, że program obsługi zdarzeń jest skojarzony ze zdarzeniem 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

Uwagi

Obiekt SearchForVirtualItemEventArgs jest konstruowany i przekazywany do SearchForVirtualItem zdarzenia podczas wywoływania FindItemWithText metod lub FindNearestItem w kontrolce w trybie wirtualnym ListView .

Konstruktory

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

Inicjuje nowe wystąpienie klasy SearchForVirtualItemEventArgs.

Właściwości

Direction

Pobiera kierunek z bieżącego elementu, który ma zostać przeszukany.

IncludeSubItemsInSearch

Pobiera wartość wskazującą, czy wyszukiwanie powinno zawierać podwitemy elementów listy.

Index

Pobiera lub ustawia indeks znalezionego ListViewItem obiektu w obiekcie ListView .

IsPrefixSearch

Pobiera wartość wskazującą, czy wyszukiwanie powinno zwrócić element, jeśli jego tekst rozpoczyna się od tekstu wyszukiwania.

IsTextSearch

Pobiera wartość wskazującą, czy wyszukiwanie jest wyszukiwaniem tekstowym.

StartIndex

Pobiera indeks, w ListViewItem którym rozpoczyna się wyszukiwanie.

StartingPoint

Pobiera lokalizację początkową wyszukiwania.

Text

Pobiera tekst użyty do znalezienia elementu w kontrolce ListView .

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy