We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize Toolbar items in Chart Control?

 

The chart toolbar can be displayed by setting ShowToolbar property as true. Toolbar can be customized by adding buttons and customizing its appearance. The Button can be added using Buttons.Add() method. The events for the corresponding buttons triggered when we click the button at run time.

Adding Buttons

C#

//Specifies the Appearance

this.Button3D.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.WindowsXP;

this.Button3D.ImageIndex = 0;

this.Button3D.ImageList = this.imageList1;

this.Button3D.Name = "Button3D";

//Specifies the type of Button

this.Button3D.PushButton = true;

this.Button3D.Size = new System.Drawing.Size(51, 22);

this.Button3D.TabIndex = 1;

//Adding the Buttons

this.chartControl1.ToolBar.Buttons.Add(this.Button3D);

VB

' Specifies the Appearance

Me.Button3D.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.WindowsXP

Me.Button3D.ImageIndex = 0

Me.Button3D.ImageList = Me.imageList1

Me.Button3D.Name = "Button3D"

' Specifies the type of Button

Me.Button3D.PushButton = True

Me.Button3D.Size = New System.Drawing.Size(51, 22)

Me.Button3D.TabIndex = 1

' Adding the Buttons

Me.ChartControl1.ToolBar.Buttons.Add(Me.Button3D)

Customizing Toolbar Items

The ToolBar items can be customized for good appearance. The Appearance of the Toolbar items can be customized using ForeColor, BackColor properties.ButtonFaltStyle property is used to set the type of Button to be displayed.

C#

// Specifes ToolBar style

this.chartControl1.ToolBar.AutoSize = true;

this.chartControl1.ToolBar.Border.ForeColor = Color.Blue;

this.chartControl1.ToolBar.Header = 2;

this.chartControl1.ToolBar.BackColor = Color.BlanchedAlmond;

// Specifies Button Style

this.chartControl1.ToolBar.ButtonFlatStyle = FlatStyle.Popup;

this.chartControl1.ToolBar.ButtonBackColor = Color.White;

this.chartControl1.ToolBar.ButtonForeColor = Color.Maroon;

VB

' Specifes ToolBar style

Me.ChartControl1.ToolBar.AutoSize = True

Me.ChartControl1.ToolBar.Border.ForeColor = Color.Blue

Me.ChartControl1.ToolBar.Header = 2

Me.ChartControl1.ToolBar.BackColor = Color.BlanchedAlmond

' Specifies Button Style

Me.ChartControl1.ToolBar.ButtonFlatStyle = FlatStyle.Popup

Me.ChartControl1.ToolBar.ButtonBackColor = Color.White

Me.ChartControl1.ToolBar.ButtonForeColor = Color.Maroon

Article ID: Published Date: Last Revised Date: Platform: Control:
69 04/30/2011 07/10/2014 Windows Forms Chart
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon