Delphi/Lazarus: Show Separator Line in Menu
Question by Guest | Last update on 2022-04-18 | Created on 2016-09-27
In some applications, I have seen, that sometimes, individual menu items are separated from each other with some kind of dividing line. This is often used, for example for grouping some menu items belonging together thematically.
However, I have never seen the possibility to set or create such a divider using Delphi or Lazarus. I have searched the object inspector for options for both, the MainMenu (TMainMenu) as well as the PopupMenu (TPopUpMenu).
Related Topics
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
Delphi/Lazarus: Command Line Parameter Tutorial Part 1: Sending
Tutorial | 0 Comments
Delphi/Lazarus: Only allow Numbers in TEdit
Tip | 0 Comments
Rewrite Text Files with a fixed Line Length
Tutorial | 0 Comments
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
Delphi/Lazarus: Show Byte Array as String of HEX Values
Tip | 0 Comments
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Indeed, there is not a real "option" for this available, you just have to know the trick:
For creating a separator line, you have to set the caption of the corresponding menu item to "-". As soon as the caption is only consisting of a hyphen, when starting the application, a menu divider is created thereof.
Here is a small example showing this behavior: MenuItem2 is becoming the separator, the items before and after are displayed with their normal caption.
Last update on 2022-04-18 | Created on 2016-09-28