ListItemCollection.CopyTo メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ListItemCollection.CopyTo メソッドの意味・解説 

ListItemCollection.CopyTo メソッド

指定した System.ArrayListItemCollection の項目をコピーしますコピー操作は、指定したインデックス位置から始まります

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As ListItemCollection
Dim array As Array
Dim index As Integer

instance.CopyTo(array, index)

パラメータ

array

ListItemCollection の項目のコピー先となる、インデックス番号が 0 から始まる System.Array。

index

項目のコピー先として指定されている System.Array最初インデックス

解説解説

このメソッド使用して指定した System.ArrayListItemCollection内容コピーしますコピー操作は、指定したインデックス位置から始まります

メモメモ

array パラメータには、インデックス番号が 0 から始まる System.Array指定する必要があります

使用例使用例
' Copy the items in the ListListBox1.Items to an array before 
' deleting them.     
Dim myListItemArray(ListBox1.Items.Count - 1) As
 ListItem
ListBox1.Items.CopyTo(myListItemArray, 0)

' Delete all the items from the ListBox.
ListBox1.Items.Clear()
DeleteLabel.Text = "<b>All items in the ListBox were deleted
 successfully." & _
                   "</b><br><b>The deleted items
 are:"
Dim listResults As [String] = ""
Dim myItem2 As ListItem
For Each myItem2 In myListItemArray
    listResults = listResults & myItem2.Text & "<br>"
Next myItem2
ResultsLabel.Text = listResults
// Copy the items in the ListItemCollection to an array before 
// deleting them.     
ListItem[] myListItemArray = new ListItem[ListBox1.Items.Count];
ListBox1.Items.CopyTo(myListItemArray, 0);

// Delete all the items from the ListBox.
ListBox1.Items.Clear();
DeleteLabel.Text = "<b>All items in the ListBox were
 deleted successfully." 
    + "</b><br><b>The deleted items are:";
String listResults="";
    foreach(ListItem myItem in myListItemArray)
    {
        listResults = listResults + myItem.Text + "<br>";
    }
ResultsLabel.Text = listResults;
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ListItemCollection クラス
ListItemCollection メンバ
System.Web.UI.WebControls 名前空間
System.Array



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ListItemCollection.CopyTo メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ListItemCollection.CopyTo メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS