ToolStripItem.MergeIndex ToolStripItem.MergeIndex ToolStripItem.MergeIndex ToolStripItem.MergeIndex Property

정의

현재 ToolStrip 안에 병합된 항목의 위치를 가져오거나 설정합니다.Gets or sets the position of a merged item within the current ToolStrip.

public:
 property int MergeIndex { int get(); void set(int value); };
public int MergeIndex { get; set; }
member this.MergeIndex : int with get, set
Public Property MergeIndex As Integer

속성 값

일치하는 값이 있으면 병합된 항목의 인덱스를 나타내는 정수이고, 그렇지 않으면 -1입니다.An integer representing the index of the merged item, if a match is found, or -1 if a match is not found.

예제

다음 예제에서는 합니다 MergeIndex 병합 된 삽입할 속성 ToolStripMenuItem 특정 위치에 있습니다.The following example uses the MergeIndex property to insert a merged ToolStripMenuItem in a specific location. 이 예제는에서 사용할 수 있는 보다 큰 예제의 일부는 ToolStripManager 클래스 개요입니다.This example is part of a larger example available in the ToolStripManager class overview.

public void ShowInsertInSameLocationSample()
{
    // Notice how the items are in backward order.  
    // This is because "merge-one" gets applied, then a search occurs for the new second position 
    // for "merge-two", and so on.
    foreach (ToolStripItem item in cmsItemsToMerge.Items)
    {
        item.MergeAction = MergeAction.Insert;
        item.MergeIndex = 2;
    }
}
Public Sub ShowInsertInSameLocationSample()
   ' Notice how the items are in backward order.  
   ' This is because "merge-one" gets applied, then a search occurs for the new second position 
   ' for "merge-two", and so on.
   Dim item As ToolStripItem
   For Each item In  cmsItemsToMerge.Items
      item.MergeAction = MergeAction.Insert
      item.MergeIndex = 2
   Next item
End Sub

설명

사용 하 여는 MergeIndex 속성을 get 또는 set의 인덱스를 ToolStripMenuItem 메뉴 병합 작업에 액세스할 수 있도록 합니다.Use the MergeIndex property to get or set the index of a ToolStripMenuItem so that you can access it for menu-merging operations.

적용 대상