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

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

WizardStepCollection.CopyTo メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

WizardStepCollection コレクション内のすべての項目を互換性のある 1 次元の WizardStepBase オブジェクト配列にコピーします。コピー先の配列の指定したインデックス位置からコピーが開始されます。

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

Public Sub CopyTo ( _
    array As WizardStepBase(), _
    index As Integer _
)
Dim instance As WizardStepCollection
Dim array As WizardStepBase()
Dim index As Integer

instance.CopyTo(array, index)
public void CopyTo (
    WizardStepBase[] array,
    int index
)
public:
void CopyTo (
    array<WizardStepBase^>^ array, 
    int index
)
public void CopyTo (
    WizardStepBase[] array, 
    int index
)
public function CopyTo (
    array : WizardStepBase[], 
    index : int
)

パラメータ

array

コレクションからコピーされた項目の格納先となるインデックス番号が 0 から始まる WizardStepBase オブジェクト配列。

index

コピーされた項目の格納先となる配列の格納開始位置。

解説解説
使用例使用例

CopyTo メソッドを使用して、コレクションの WizardStepBase オブジェクトを配列にコピーする方法の例を次に示します。その後、配列が反復処理され、WizardStepBase の各派生オブジェクトの ID プロパティが表示されます。この例では、Wizard コントロールの WizardSteps プロパティは、WizardStepCollection クラスのインスタンスです。

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  
  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)

    ' Declare an array of WizardStepBase objects.
    Dim stepArray(Wizard1.WizardSteps.Count - 1) As
 WizardStep

    ' Use the CopyTo method to copy the WizardStep items 
    ' of the Wizard control into the array.
    Wizard1.WizardSteps.CopyTo(stepArray, 0)
    
    ' Display the WizardStep items.
    Message.Text = "The WizardStepBase items of the Wizard1 control
 are: <br/><br/>"
    
    For i As Integer = 0
 To stepArray.Length - 1
      Message.Text &= stepArray(i).ID & "<br>"
    Next

  End Sub

</script>

<html  >
  <body>
    <form id="form1" runat="server">
      <asp:Wizard id="Wizard1" 
        runat="server" >
        <WizardSteps>
          <asp:WizardStep id="WizardStep1" 
            runat="server" 
            title="Step 1">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep2" 
            runat="server" 
            title="Step 2">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep3" 
            runat="server" 
            title="Step 3">
          </asp:WizardStep>
        </WizardSteps>
        <HeaderTemplate>
          <b>WizardStepCollection CopyTo Example</b>
        </HeaderTemplate>
      </asp:Wizard>
      <asp:label id="Message" 
        runat="server"/>
    </form>
  </body>
</html>
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  void Page_Load(Object sender, EventArgs e)
  {

    // Declare an array of WizardStepBase objects.
    WizardStepBase[] stepArray = new WizardStepBase[Wizard1.WizardSteps.Count];

    // Use the CopyTo method to copy the WizardStep items 
    // of the Wizard control into the array.
    Wizard1.WizardSteps.CopyTo(stepArray, 0);
    
    // Display the WizardStep items.
    Message.Text = "The WizardStepBase items of the Wizard1 control are: <br/><br/>";
    
    for (int i = 0; i < stepArray.Length;
 i++)
    {
      Message.Text += stepArray[i].ID + "<br>";
    }

  }


</script>

<html  >
  <body>
    <form id="form1" runat="server">
      <asp:Wizard id="Wizard1" 
        runat="server" >
        <WizardSteps>
          <asp:WizardStep id="WizardStep1" 
            runat="server" 
            title="Step 1">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep2" 
            runat="server" 
            title="Step 2">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep3" 
            runat="server" 
            title="Step 3">
          </asp:WizardStep>
        </WizardSteps>
        <HeaderTemplate>
          <b>WizardStepCollection CopyTo Example</b>
        </HeaderTemplate>
      </asp:Wizard>
      <asp:label id="Message" 
        runat="server"/>
    </form>
  </body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WizardStepCollection クラス
WizardStepCollection メンバ
System.Web.UI.WebControls 名前空間
WizardStepBase クラス
GetEnumerator
その他の技術情報
Wizard Web サーバー コントロール


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

英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

   

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



WizardStepCollection.CopyTo メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS