CacheVirtualItemsEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 CacheVirtualItems 事件的資料。
public ref class CacheVirtualItemsEventArgs : EventArgs
public class CacheVirtualItemsEventArgs : EventArgs
type CacheVirtualItemsEventArgs = class
inherit EventArgs
Public Class CacheVirtualItemsEventArgs
Inherits EventArgs
- 繼承
範例
下列程式代碼範例示範此類型的用法。 在這個例子中,事件處理者會回報事件 CacheVirtualItems 的發生情況。 此報告能幫助您了解事件發生時間,並協助除錯。 若要報告多個事件或頻繁發生的事件,請考慮將Show訊息替換Console.WriteLine為或附加於多行TextBox。
要執行範例程式碼,請將其貼到包含一個 ListView 名為 ListView1的實例的專案中。 然後確保事件處理程式與事件 CacheVirtualItems 相關聯。
private void ListView1_CacheVirtualItems(Object sender, CacheVirtualItemsEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "StartIndex", e.StartIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "EndIndex", e.EndIndex );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "CacheVirtualItems Event" );
}
Private Sub ListView1_CacheVirtualItems(sender as Object, e as CacheVirtualItemsEventArgs) _
Handles ListView1.CacheVirtualItems
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "StartIndex", e.StartIndex)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "EndIndex", e.EndIndex)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"CacheVirtualItems Event")
End Sub
備註
CacheVirtualItems當虛擬模式下新區域ListView被曝光,並ListView決定需要新的物品範圍時,事件就會發生。
建構函式
| 名稱 | Description |
|---|---|
| CacheVirtualItemsEventArgs(Int32, Int32) |
初始化一個包含指定起始與結束索引的新類別實例 CacheVirtualItemsEventArgs 。 |
屬性
| 名稱 | Description |
|---|---|
| EndIndex |
取得虛擬模式下控制項所需 ListView 值範圍的結尾索引。 |
| StartIndex |
取得虛擬模式下控制項所需 ListView 值範圍的起始索引。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |