อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


MenuItem.Break Property

Definition

Gets or sets a value indicating whether the item is placed on a new line (for a menu item added to a MainMenu object) or in a new column (for a menu item or submenu item displayed in a ContextMenu).

C#
[System.ComponentModel.Browsable(false)]
public bool Break { get; set; }

Property Value

true if the menu item is placed on a new line or in a new column; false if the menu item is left in its default placement. The default is false.

Attributes

Examples

The following code example creates a menu with two top-level menu items on the top row and one menu item on the bottom row.

C#
public void CreateMyMenus()
{
   // Create three top-level menu items.
   MenuItem menuItem1 = new MenuItem("&File");
   MenuItem menuItem2 = new MenuItem("&Options");
   MenuItem menuItem3 = new MenuItem("&Edit");
   // Place the "Edit" menu on a new line in the menu bar.
   menuItem3.Break = true;
}

Remarks

You can use the Break property to create a menu where each menu is placed next to each other horizontally instead of in a vertical list. You can also use this property to create a menu bar that contains multiple rows of top-level menu items.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10

See also