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

Dim instance As WizardStepCollection Dim index As Integer Dim wizardStep As WizardStepBase instance.Insert(index, wizardStep)

Insert メソッドは、WizardStepBase の派生オブジェクトを、コレクションの指定したインデックス位置に追加します。
代わりに、AddAt メソッドを使用して、WizardStepBase の派生オブジェクトをコレクションに追加することもできます。WizardStepBase の派生オブジェクトを WizardStepCollection コレクションの末尾に追加するには、Add メソッドを使用します。
![]() |
---|
Insert メソッドと AddAt メソッドは、実質的に同じ機能を実行します。Insert メソッドが呼び出された場合、単に wizardStep パラメータと index パラメータが AddAt メソッドに渡されます。 |

プログラムによって Wizard コントロールを作成し、Insert メソッドを使用して WizardStepBase の派生オブジェクトを WizardSteps コレクションに追加する方法を次のコード例に示します。この例では、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"> ' Programmatically create a Wizard control and dynamically ' add WizardStep objects to it. Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim WizardControl As Wizard = New Wizard() ' Create some steps for the wizard and insert them ' into the WizardStepCollection collection. For i As Integer = 0 To 5 Dim newStep As WizardStepBase = New WizardStep() newStep.ID = "Step" + (i + 1).ToString() WizardControl.WizardSteps.Insert(0, newStep) Next WizardControl.ActiveStepIndex = 0 WizardControl.DisplaySideBar = True ' Display the wizard on the page. PlaceHolder1.Controls.Add(WizardControl) End Sub </script> <html> <body> <form id="Form1" runat="server"> <h3>WizardStepCollection Insert Example</h3> <asp:PlaceHolder id="PlaceHolder1" 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"> // Programmatically create a Wizard control and dynamically // add WizardStep objects to it. void Page_Load(object sender, EventArgs e) { Wizard WizardControl = new Wizard(); // Create some steps for the wizard and insert them // into the WizardStepCollection collection. for (int i = 0; i <= 5; i++) { WizardStepBase newStep = new WizardStep(); newStep.ID = "Step" + (i + 1).ToString(); WizardControl.WizardSteps.Insert(0, newStep); } WizardControl.ActiveStepIndex = 0; WizardControl.DisplaySideBar = true; // Display the wizard on the page. PlaceHolder1.Controls.Add(WizardControl); } </script> <html> <body> <form id="Form1" runat="server"> <h3>WizardStepCollection Insert Example</h3> <asp:PlaceHolder id="PlaceHolder1" 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.Insert メソッドを検索する場合は、下記のリンクをクリックしてください。

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