Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, menus; Type tform1 = Class (tform) Procedure formcreate (Sender: tobject ); end; var form1: tform1; implementation {$ R *. DFM} var mymenu: tmainmenu; item: tmenuitem; Procedure tform1.formcreate (Sender: tobject); var itemd: tmenuitem; begin mymenu: = tmainmenu. create (Self); mymenu. autohotkeys: = mamanual; mymenu. autolinereduction: = maautomatic; {redundant split lines are automatically hidden by default} // mymenu. autolinereduction: = mamanual; {set to manually display all split lines} self. menu: = mymenu; item: = tmenuitem. create (mymenu); item. caption: = 'a'; mymenu. items. add (item); itemd: = tmenuitem. create (mymenu); itemd. caption: = 'a & 1'; item. add (itemd); itemd: = tmenuitem. create (mymenu); itemd. caption: = '-'; {This is the split line} item. add (itemd); itemd: = tmenuitem. create (mymenu); itemd. caption: = '-'; {This is the split line} item. add (itemd); itemd: = tmenuitem. create (item); itemd. caption: = 'a & 2'; item. add (itemd); itemd: = tmenuitem. create (mymenu); itemd. caption: = '-'; {This is the split line} item. add (itemd); end.
: