How To…Add a Button to the Preview

Question

“How do I add a custom button to the preview toolbar?”

Solution

Create a Preview Plugin that overrides the CreateToolbarItems routine. Use the Toolbar.AddButton routine to add a new button to the toolbar before the default buttons are created. Take a look at the TppPreview.CreateToolbarItems routine located in the ppPreview.pas file for examples of how the existing buttons are created.

Download: AddButtonToPreview.zip

Sample Delphi code: