Parents | Children | Properties | Methods | Events |
Purpose: | A horizontal or vertical line used to separate items in a menu. |
Description
This object provides a vertical or horizontal line to separate items in a Menu. It may also be used to split a MenuBar over more than one line.
The orientation of the Separator is determined by its Style property, which may be 'Horz' (horizontal) or 'Vert' (vertical). The default is 'Horz'.
If you want to provide a menu with a 3-Dimensional (pushbutton) appearance, you should also set the EdgeStyle property on any Separator objects in it. Alternatively, you can achieve the same effect by setting the background colour (BCol) for the Separators to grey (192 192 192).
The Posn property is a single integer number which specifies the positional index of the Separator relative to the other objects in the Menu. A Separator does not generate any events.
Like other components of a menu, the position of a Separator is normally determined by the order in which it is created in relation to other objects with the same parent. However, you can use the Posn property to insert a Separator into an existing structure. For example, having defined three MenuItem objects as children of a Menu, you can insert a Separator between the first and the second by specifying its Posn to be 2. Note that the value of Posn for the MenuItems that were previously second and third will then be reset to third and fourth respectively.
If you put a Separator (either Style) into a MenuBar, it has the effect of adding another line to it. Any items added after the Separator will appear in the new line.