語言

CollectionView.SetCurrent 方法

定義

設定 的當前項目 CollectionView。

多載

名稱 Description
SetCurrent(Object, Int32)

將指定的項目和索引設定為 和 CurrentItem 屬性的CurrentPosition值。

SetCurrent(Object, Int32, Int32)

將指定的項目和索引設定為 和 CurrentItem 屬性的CurrentPosition值。 此方法可從導出類別的建構子呼叫。

SetCurrent(Object, Int32)

將指定的項目和索引設定為 和 CurrentItem 屬性的CurrentPosition值。

protected:
 void SetCurrent(System::Object ^ newItem, int newPosition);
protected void SetCurrent(object newItem, int newPosition);
member this.SetCurrent : obj * int -> unit
Protected Sub SetCurrent (newItem As Object, newPosition As Integer)

參數

newItem
Object

要設定為 CurrentItem的項目。

newPosition
Int32

將價值設為 CurrentPosition 房產價值。

適用於

SetCurrent(Object, Int32, Int32)

將指定的項目和索引設定為 和 CurrentItem 屬性的CurrentPosition值。 此方法可從導出類別的建構子呼叫。

protected:
 void SetCurrent(System::Object ^ newItem, int newPosition, int count);
protected void SetCurrent(object newItem, int newPosition, int count);
member this.SetCurrent : obj * int * int -> unit
Protected Sub SetCurrent (newItem As Object, newPosition As Integer, count As Integer)

參數

newItem
Object

要設定為 CurrentItem的項目。

newPosition
Int32

將價值設為 CurrentPosition 房產價值。

備註

從衍生類別的建構子呼叫此過載。 不要將該性質(虛擬性質)傳遞 Count 為 count。 相反地,傳遞代表該集合的內部 IList 計數。

SetCurrent 於 .NET Framework 3.5 版本中引入。 欲了解更多資訊,請參閱 版本與相依關係。

適用於