Gets or sets a value indicating whether the item is placed on a new line (for a menu item added to a TBD object) or in a new column (for a submenu or menu displayed in a TBD).
[Visual Basic] Public Property BarBreak As Boolean [C#] public bool BarBreak {get; set;} [C++] public: __property bool get_BarBreak(); public: __property void set_BarBreak(bool); [JScript] public function get BarBreak() : Boolean; public function set BarBreak(Boolean);
true to place the menu item on a new line or in a new column; false to leave the menu item in its default placement. The default is false.
You can use the TBD property to create a menu where each menu item 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 contians multiple rows of top-level menu items.
This property differs from the Break property in that a bar is displayed on the left edge of each menu item that has the TBD property set to true. The bar is only displayed when the menu item is not a top-level menu item.
The following example creates a TBD with two submenu items. The two submenu items are displayed horizontally instead of vertically.
[Visual Basic]
Public Sub CreateMyMenus() ' Create three top-level menu items. Dim MenuItem1 as MenuItem Dim MenuItem2 as MenuItem Dim MenuItem3 as MenuItem ' Intialize the menu items with captions. Set MenuItem1 = New MenuItem("File") Set MenuItem2 = New MenuItem("New") Set MenuItem3 = New MenuItem("Open") ' Set the BarBreak property to display horizontally. MenuItem2.BarBreak = True MenuItem3.BarBreak = True ' Create a menu item array to store the sub menu items. Dim tempMenus(1) as MenuItem 'Add MenuItem2 and MenuItem3 to the tempMenus array. Set tempMenus(0) = MenuItem2 Set tempMenus(1) = MenuItem3 ' Assign the tempMenus to MenuItem1. MenuItem1.MenuItems.All = tempMenus End Sub
MenuItem Class | MenuItem Members | System.WinForms Namespace | Break