次の方法で共有


DataRepeater.DisplayedItemCount プロパティ

数を取得します。DataRepeaterItemで表示される項目、DataRepeater部分的になど必要に応じて、コントロールの項目を表示します。

名前空間:  Microsoft.VisualBasic.PowerPacks
アセンブリ:  Microsoft.VisualBasic.PowerPacks.Vs (Microsoft.VisualBasic.PowerPacks.Vs.dll 内)

構文

'宣言
<BrowsableAttribute(False)> _
Public ReadOnly Property DisplayedItemCount ( _
    includePartialItems As Boolean _
) As Integer
[BrowsableAttribute(false)]
public int this[
    bool includePartialItems
] { get; }
[BrowsableAttribute(false)]
public:
property int DisplayedItemCount[bool includePartialItems] {
    int get (bool includePartialItems);
}
[<BrowsableAttribute(false)>]
member DisplayedItemCount : 
        includePartialItems:bool -> int with get
JScript では、インデックス付きプロパティはサポートされません。

パラメーター

  • includePartialItems
    型 : Boolean

    true表示される項目数を部分的に含めるfalseを完全に表示されたアイテムのみが含まれます。

プロパティ値

型 : Int32
表示される項目のカウント。

解説

このプロパティを使用して数DataRepeaterItem項目は、DataRepeaterコントロールです。

次の例で表示されている項目の数を返す方法、DataRepeaterコントロールです。

Private Sub Button1_Click() Handles Button1.Click
    Dim msgString As String 
    Dim intFull As Integer 
    Dim intPartial As Integer 
    ' Get the count without including partially displayed items.
    intFull = DataRepeater1.DisplayedItemCount(False)
    ' Get the count, including partially displayed items.
    intPartial = DataRepeater1.DisplayedItemCount(True)
    ' Create the message string.
    msgString = CStr(intFull)
    msgString &= " items are fully visible and " 
    ' Subtract the full count from the partial count.
    msgString &= CStr(intPartial - intFull)
    msgString &= " items are partially visible."
    MsgBox(msgString)
End Sub
private void button1_Click(System.Object sender, System.EventArgs e)
{
    string msgString;
    int intFull;
    int intPartial;
    string stringFull;
    string stringPartial;
    // Get the count without including partially displayed items.
    intFull = dataRepeater1.get_DisplayedItemCount(false);
    // Get the count, including partially displayed items.
    intPartial = dataRepeater1.get_DisplayedItemCount(true);
    // Create the message string.
    stringFull = intFull.ToString();
    msgString = stringFull;
    msgString = msgString + " items are fully visible and ";
    // Subtract the full count from the partial count.
    intPartial = intPartial - intFull;
    stringPartial = intPartial.ToString();
    msgString = msgString + stringPartial;
    msgString = msgString + " items are partially visible.";
    MessageBox.Show(msgString);
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

DataRepeater クラス

Microsoft.VisualBasic.PowerPacks 名前空間

FirstDisplayedItemIndex

その他の技術情報

DataRepeater コントロールの概要 (Visual Studio)