StatusBar.StatusBarPanelCollection.Insert(Int32, StatusBarPanel) StatusBar.StatusBarPanelCollection.Insert(Int32, StatusBarPanel) StatusBar.StatusBarPanelCollection.Insert(Int32, StatusBarPanel) StatusBar.StatusBarPanelCollection.Insert(Int32, StatusBarPanel) Method

定义

将指定的 StatusBarPanel 插入集合中的指定索引处。Inserts the specified StatusBarPanel into the collection at the specified index.

public:
 virtual void Insert(int index, System::Windows::Forms::StatusBarPanel ^ value);
public virtual void Insert (int index, System.Windows.Forms.StatusBarPanel value);
abstract member Insert : int * System.Windows.Forms.StatusBarPanel -> unit
override this.Insert : int * System.Windows.Forms.StatusBarPanel -> unit
Public Overridable Sub Insert (index As Integer, value As StatusBarPanel)

参数

index
Int32 Int32 Int32 Int32

插入面板的从零开始的索引位置。The zero-based index location where the panel is inserted.

value
StatusBarPanel StatusBarPanel StatusBarPanel StatusBarPanel

一个 StatusBarPanel,表示要插入的面板。A StatusBarPanel representing the panel to insert.

异常

value 参数为 nullThe value parameter is null.

value 参数的父级不为 nullThe value parameter's parent is not null.

index 参数小于零或大于 Count 类的 StatusBar.StatusBarPanelCollection 属性的值。The index parameter is less than zero or greater than the value of the Count property of the StatusBar.StatusBarPanelCollection class.

value 参数的面板的 AutoSize 属性不是一个有效的 StatusBarPanelAutoSize 值。The AutoSize property of the value parameter's panel is not a valid StatusBarPanelAutoSize value.

注解

您可以添加到面板StatusBar控件来显示多个类型的信息。You can add panels to a StatusBar control to display more than one type of information. Insert方法,可创建一个新StatusBarPanel并将其插入集合中的特定位置。The Insert method enables you to create a new StatusBarPanel and insert it at a specific location within the collection. 在其中面板位于中的顺序StatusBar.StatusBarPanelCollection表示面板中的显示顺序StatusBar控件。The order in which panels are located in the StatusBar.StatusBarPanelCollection represents the order that panels are displayed within the StatusBar control. 面板显示从左到右从集合中的第一个面板。Panels are displayed from left to right starting with the first panel in the collection. RightToLeft的属性StatusBar控件不会更改面板中的显示的顺序StatusBarThe RightToLeft property of the StatusBar control does not change the order in which panels are displayed in the StatusBar. 若要将面板添加到集合末尾,使用Add方法。To add a panel to the end of the collection, use the Add method. 若要将一组面板添加到单个操作中的集合,使用AddRange方法。To add a set of panels to the collection in a single operation, use the AddRange method.

适用于

另请参阅