[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Viewer.Win.Viewer.Toolbar

Toolbar Property

Toolbar

Provides access to the viewer's toolbar, allowing for customization and control of toolbar buttons and functionality.

Declaration
public Viewer.ViewerToolbar Toolbar { get; }
Property Value
Type Description
Viewer.ViewerToolbar

A Viewer.ViewerToolbar instance that represents the toolbar in the viewer.

Remarks

The toolbar is a key component of the viewer's user interface, offering quick access to common actions such as navigation, zoom, and print. This property allows developers to customize the toolbar to better suit their application's needs.

Examples
public void AddCustomButtonToViewerToolbar(Viewer viewer)
{
	// Create a new ToolStripButton
	var customButton = new ToolStripButton
	{
	    Name = "customButton",
	    Text = "Custom Action"
	};
	customButton.Click += CustomButton_Click;
	// Add the button to the Viewer's ToolStrip
	viewer.Toolbar.ToolStrip.Items.Add(customButton);
}
private void CustomButton_Click(object sender, EventArgs e)
{
	// Custom action
	MessageBox.Show("Custom action executed.");
}
public void RemoveButtonFromViewerToolbar(Viewer viewer, string buttonName)
{
	var item = viewer.Toolbar.ToolStrip.Items[buttonName];
	if (item != null)
	{
	    viewer.Toolbar.ToolStrip.Items.Remove(item);
	}
}