How Can I Implement Highlighted Toolbar Icons With Delphi?

后端 未结 3 1991
花落未央
花落未央 2021-02-10 12:29

I\'d like to highlight my toolbar icons when their associated action has it\'s \"checked\" property set to true. I\'d like to do it in a manner similar to how Microsoft Office 2

3条回答
  •  庸人自扰
    2021-02-10 13:14

    Add a TActionManager to the form, and create some actions (e.g., bold, italic, and underline). Make sure to set the AutoCheck property to true for each action. Then add a TActionToolbar. Double-click the action manager, and drag the three actions to the toolbar. Now add a TXPColorMap to the form, and assign it to the action manager. Also add a TImageList and add icons for bold, italic, and underline (from C:\Program Files (x86)\Common Files\CodeGear Shared\Images\GlyFX\Icons\BMP\16x16). Assign the image list to the action manager.

    Set the toolbar icons to show only the glyph and not the caption. Finally, set the ActionManager's Style property to XP Style. The end result is what you seek.

    Toolbar sample

提交回复
热议问题