WizardStepCollection.CopyTo メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim instance As WizardStepCollection Dim array As WizardStepBase() Dim index As Integer instance.CopyTo(array, index)

CopyTo メソッドを使用して、インデックス番号が 0 から始まる指定した配列にコレクションの内容をコピーします。項目は、対象の配列の指定されたインデックスを開始位置としてコピーされます。項目が配列に挿入されたら、配列の構文を使用して WizardStepCollection コレクション内の項目にアクセスできます。
別の方法として、GetEnumerator メソッドを使用して、コレクション内の項目にアクセスするために使用できる列挙子を作成することもできます。

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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWizardStepCollection.CopyTo メソッドを検索する場合は、下記のリンクをクリックしてください。

- WizardStepCollection.CopyTo メソッドのページへのリンク