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 サーバー コントロール



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS