ToolStripItem.MergeIndex 속성

정의

현재 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입니다.

예제

다음 예제에서는 사용 된 MergeIndex 특정 위치에 병합 된 ToolStripMenuItem 삽입 하는 속성입니다. 이 예제는에서 사용할 수 있는 보다 큰 예제의 일부는 ToolStripManager 클래스 개요입니다.

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 메뉴 병합 작업에 액세스할 수 있도록 속성을 사용하여 의 ToolStripMenuItem 인덱스를 가져오거나 설정합니다.

적용 대상