There are a number of ways in which you can customize the Viewer control to make it a perfect fit for your Windows application. You can add and remove buttons from the toolbars, add and remove menu items, create custom dialogs, and call them from custom click events.
You can use the methods listed in the System.Windows.Forms.ToolStripItemCollection documentation on MSDN to customize each ToolStrip.
ToolStrip
TheToolStrip contains the following ToolStripItems by index number.
- 0 Toggle sidebar
- 1 Separator
- 2 Print
- 3 Galley mode
- 4 Separator
- 5 Copy
- 6 Find
- 7 Separator
- 8 Zoom out
- 9 Zoom In
- 10 Current Zoom
- 11 Separator
- 12 Fit width
- 13 Fit page
- 14 Separator
- 15 Single page
- 16 Continuous mode
- 17 Multipage mode
- 18 Separator
- 19 First page
- 20 Previous page
- 21 Current
- 22 Next page
- 23 Last page
- 24 Separator
- 25 History back
- 26 History forward
- 27 Separator
- 28 Back to parent
- 29 Separator
- 30 Refresh
- 31 Cancel button
- 32 Separator
- 33 Pan mode
- 34 Copy select
- 35 Snapshot
- 36 Separator
- 37 Annotations
You can access these ToolStripItems by index with the Insert and RemoveAt methods. Other methods, including Add and AddRange, are described in the System.Windows.Forms.ToolStripItemCollection documentation on MSDN.
Tool Click Implementation
When you add a new item to a ToolStrip, you need to add an ItemClicked event handler and an ItemClicked event for the ToolStrip with the new item. At run time, when a user clicks the new ToolStrip item, they raise the ItemClicked event of the ToolStrip containing the item
Add the event handler to the Load event of the Form that contains the Viewer control, and use the IntelliSense Generate Method Stub feature to create the related event. For examples of the code to create an event hander, see the Viewer.ViewerToolbar Class, the Customize the Viewer Control topic, and the Custom Preview sample that is located in ...\Documents\ComponentOne Samples\ActiveReports Developer 7\Section Reports\C#\CustomPreview.