MenuItem.MergeType Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą zachowanie tego elementu menu, gdy jego menu jest scalane z innym.

public:
 property System::Windows::Forms::MenuMerge MergeType { System::Windows::Forms::MenuMerge get(); void set(System::Windows::Forms::MenuMerge value); };
public System.Windows.Forms.MenuMerge MergeType { get; set; }
member this.MergeType : System.Windows.Forms.MenuMerge with get, set
Public Property MergeType As MenuMerge

Wartość właściwości

MenuMerge

MenuMerge Wartość reprezentująca typ scalania elementu menu.

Wyjątki

Przypisana wartość nie jest jedną z MenuMerge wartości.

Przykłady

Poniższy przykładowy kod tworzy obiekt MenuItem z określonymi elementami MergeType i MergeOrder tak, aby element menu został dodany do scalonego menu na pierwszej pozycji.

public:
   void InitMyFileMenu()
   {
      // Set the MergeType to Add so that the menu item is added to the merged menu.
      menuItem1->MergeType = MenuMerge::Add;
      // Set the MergeOrder to 1 so that this menu item is placed lower in the merged menu order.
      menuItem1->MergeOrder = 1;
   }
public void InitMyFileMenu()
{
   // Set the MergeType to Add so that the menu item is added to the merged menu.
   menuItem1.MergeType = MenuMerge.Add;
   // Set the MergeOrder to 1 so that this menu item is placed lower in the merged menu order.
   menuItem1.MergeOrder = 1;
}
Public Sub InitMyFileMenu()
    ' Set the MergeType to Add so that the menu item is added to the merged menu.
    menuItem1.MergeType = MenuMerge.Add
    ' Set the MergeOrder to 1 so that this menu item is placed lower in the merged menu order.
    menuItem1.MergeOrder = 1
End Sub

Uwagi

Typ scalania elementu menu wskazuje, jak zachowuje się element menu, gdy ma taką samą kolejność scalania, jak scalany inny element menu. Możesz użyć scalonych menu, aby utworzyć skonsolidowane menu na podstawie co najmniej dwóch istniejących menu.

Dotyczy

Zobacz też