ListViewItemMouseHoverEventArgs 類別

定義

提供 ItemMouseHover 事件的資料。Provides data for the ItemMouseHover event.

public ref class ListViewItemMouseHoverEventArgs : EventArgs
public class ListViewItemMouseHoverEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class ListViewItemMouseHoverEventArgs : EventArgs
type ListViewItemMouseHoverEventArgs = class
    inherit EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
type ListViewItemMouseHoverEventArgs = class
    inherit EventArgs
Public Class ListViewItemMouseHoverEventArgs
Inherits EventArgs
繼承
ListViewItemMouseHoverEventArgs
屬性

範例

下列程式碼範例將示範如何使用這個型別。The following code example demonstrates the use of this type. 在此範例中,事件處理常式會報告事件的發生情況 ItemMouseHoverIn the example, an event handler reports on the occurrence of the ItemMouseHover event. 這份報告可協助您瞭解發生事件的時間,並協助您進行調試。This report helps you to learn when the event occurs and can assist you in debugging. 若要報告多個事件或經常發生的事件,請考慮將取代為 Show 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.

若要執行範例程式碼,請將它貼到包含名為之類型實例的專案中 ListView ListView1To run the example code, paste it into a project that contains an instance of type ListView named ListView1. 然後確定事件處理常式與事件相關聯 ItemMouseHoverThen ensure that the event handler is associated with the ItemMouseHover event.

private void ListView1_ItemMouseHover(Object sender, ListViewItemMouseHoverEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Item", e.Item );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ItemMouseHover Event" );
}
Private Sub ListView1_ItemMouseHover(sender as Object, e as ListViewItemMouseHoverEventArgs) _ 
     Handles ListView1.ItemMouseHover

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

End Sub

備註

ItemMouseHover當滑鼠指標停留在上時,就會發生此事件 ListViewItemThe ItemMouseHover event occurs when the mouse pointer hovers over a ListViewItem.

建構函式

ListViewItemMouseHoverEventArgs(ListViewItem)

初始化 ListViewItemMouseHoverEventArgs 類別的新執行個體。Initializes a new instance of the ListViewItemMouseHoverEventArgs class.

屬性

Item

取得滑鼠指標目前正停留在其上方的項目。Gets the item the mouse pointer is currently hovering over.

方法

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()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於