Can Delphi themed toolbars have dividers that are centred between their tool buttons?

后端 未结 3 1986
暗喜
暗喜 2020-12-11 17:27

I have noticed a rather annoying oddity with Delphi toolbars. I have a TToolbar that has logical groups of icons. To make the grouping stand out I would like to

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 17:52

    As already explained, you can't do this using TToolBar due to changes in the Operating System.

    However, by using ActionToolBars you can achieve what you want to achieve - even with the current version of Delphi (XE6) and Windows 8.1/2012 R2 theming. Here's the steps:

    1. Create an Action Manager
    2. Add as many actions as you intend to have
    3. Add an ImageList (and another optional one for Disabled Menu Items)
    4. Associate each one of your actions with an image
    5. Add an ActionToolBar to the form
    6. Drag and drop each action you wish to appear on the toolbar to the toolbar
    7. Set individual actions on the toolbar to ShowCaption := False (if desired)
    8. Drag and drop the "Drag to create Separators" (from the ActionManager editor) box to add separators
    9. Drag and drop the ActionClientItems (created when you drag and drop actions onto the ActionTooLBar) to where you'd like them to be.

    End Result - A nice looking app with dividers betwen your icons.

    enter image description here

提交回复
热议问题