I have a mainmenu on my Form and I want to be able to insert separator to it programmatically not during design time. I went through context popup menu for the mainmenu that lists all the available properties and did not find anything that will allow me to insert separator. Google wasn't much of a help. So, how is this done in Delphi on Windows? I am using Delphi 2010.
I simply want to do something like the following but AddSeparator
command doesn't exist:
MainMenu1.Items[5].AddSeparator;
Create a new menu item and set its caption to
'-'
.Instead of
Add
, which adds to the end of the menu, you can useInsert
to insert the item into the middle of the menu.The documentation says: