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

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

SelectedDatesCollection.CopyTo メソッド

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

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

Dim instance As SelectedDatesCollection
Dim array As Array
Dim index As Integer

instance.CopyTo(array, index)

パラメータ

array

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

index

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

解説解説
使用例使用例

CopyTo メソッド使用して指定した配列SelectedDatesCollection の項目をコピーする方法次のコード例示します

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
 <head>
 
    <script runat="server">

        Sub Select_Change(sender As Object,
 e As EventArgs)
            
            Dim myDateArray(Calendar1.SelectedDates.Count) As
 DateTime
            
            ' Copy the collection to  array.
            Calendar1.SelectedDates.CopyTo(myDateArray, 0)
            
            Label1.Text = "The dates selected are: "
            
            ' Loop through the IEnumerator and display the contents.
            Dim theDate As DateTime
            For Each theDate In
  myDateArray
                Label1.Text &= " " & theDate.Day.ToString()
            Next
        End Sub
 
    </script>
 
 </head>     
 <body>
 
    <form runat="server">
 
       <asp:Calendar ID="Calendar1" runat="server"
  
            SelectionMode="DayWeekMonth" 
            OnSelectionChanged="Select_Change"/>
 
       <hr>
 
       Select dates from the Calendar.<br><br>
 
       <asp:Label id="Label1" runat=server />
 
    </form>
 </body>
 </html>
   
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
 <head>
 
    <script runat="server">
 
       void Select_Change(Object sender, EventArgs e) 
       {
          
          DateTime[] myDateArray = new DateTime[Calendar1.SelectedDates.Count];
 
          // Copy the collection to an array.
          Calendar1.SelectedDates.CopyTo(myDateArray, 0);      
  
          Label1.Text = "The dates selected are: ";
 
          // Loop through the IEnumerator and display the contents.
          foreach (DateTime date in myDateArray)
 
          {
          
             Label1.Text += " " + date.Day.ToString();
 
          }
       }
 
    </script>
 
 </head>     
 <body>
 
    <form runat="server">
 
       <asp:Calendar ID="Calendar1" runat="server"  
            SelectionMode="DayWeekMonth" 
            OnSelectionChanged="Select_Change"/>
 
       <hr>
 
       Select dates from the Calendar.<br><br>
 
       <asp:Label id="Label1" runat=server />
 
    </form>
 </body>
 </html>
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SelectedDatesCollection クラス
SelectedDatesCollection メンバ
System.Web.UI.WebControls 名前空間
System.Array


このページでは「.NET Framework クラス ライブラリ リファレンス」からSelectedDatesCollection.CopyTo メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSelectedDatesCollection.CopyTo メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSelectedDatesCollection.CopyTo メソッド を検索

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS