BaseControlArray.BaseSetIndex(Object, Int16, Boolean) 方法

定義

設定控制項陣列中的控制項索引。Sets the index for a control in a control array.

protected void BaseSetIndex (object ctl, short Index, bool fIsDynamic = false);
member this.BaseSetIndex : obj * int16 * bool -> unit
Protected Sub BaseSetIndex (ctl As Object, Index As Short, Optional fIsDynamic As Boolean = false)

參數

ctl
Object

您要設定其索引的 ControlThe Control for which you want to set the index.

Index
Int16

Short 整數,表示控制項的索引。A Short integer that represents the index for the control.

fIsDynamic
Boolean

選擇性。Optional. Boolean,指定控制項是在設計階段 (false) 或執行階段 (true) 建立的。A Boolean specifying whether the control was created at design time (false) or at run time (true).

備註

對升級自 Visual Basic 6.0 之應用程式中使用的所有控制項陣列而言,BaseControlArray 是基底類別。The BaseControlArray class is the base class for all control arrays that are used in applications upgraded from Visual Basic 6.0. 由於通常不會使用此類別建立類別的執行個體,因此通常不會直接呼叫這個 Protected 方法,而是由衍生類別呼叫。Because this class is not typically used to create an instance of the class, this Protected method is usually not called directly but is instead called by a derived class.

注意

Microsoft.VisualBasic.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。Functions and objects in the Microsoft.VisualBasic.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. 在大多數情況下,這些函式和物件會複製在 .NET Framework 其他命名空間中可以找到的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. 只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才會需要這些函式和物件。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

給繼承者的注意事項

當您 BaseSetIndex 在衍生類別中覆寫時,請勿呼叫 BaseSetIndex 基類的方法。When you override BaseSetIndex in a derived class, do not call the BaseSetIndex method of the base class.

適用於