ActiveReports 6 Online Help
Add Method (ToolsCollection)
Example 

The toolbar Tool to be added to the collection.
Adds a new toolbar tool to the end of the toolbar tool collection.
Syntax
'Declaration
 
Public Function Add( _
   ByVal value As Tool _
) As Integer
public int Add( 
   Tool value
)

Parameters

value
The toolbar Tool to be added to the collection.
Example
private void arv_Load(object sender, System.EventArgs e)
{
    DataDynamics.ActiveReports.Toolbar.Tool[] arr = new DataDynamics.ActiveReports.Toolbar.Tool[2];
    DataDynamics.ActiveReports.Toolbar.Button b = new DataDynamics.ActiveReports.Toolbar.Button();
    b.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.Icon;
    b.Enabled = true;
    b.Id = 777;
    b.ImageIndex = 0;
    b.ToolTip = "Do not click here.";
    b.Visible = true;

    System.Windows.Forms.ImageList i = new ImageList();
    i.Images.Add(Image.FromFile("c:\\icons\\Zero Suit.ico"));
    i.Images.Add(Image.FromFile("c:\\icons\\The Other Band.ico"));


    DataDynamics.ActiveReports.Viewer.ToolbarObject t = new DataDynamics.ActiveReports.Viewer.ToolbarObject(arv);
    t.DisplayToolTips = true;
    t.Images = i;
    t.Tools.AddRange(arr);

    rptDD rpt = new rptDD();
    rpt.Run();
    arv.Document = rpt.Document;
}
Private Sub arv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arv.Load
    Dim arr(1) As DataDynamics.ActiveReports.Toolbar.Tool
    Dim b As New DataDynamics.ActiveReports.Toolbar.Button
    b.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.Icon
    b.Enabled = True
    b.Id = 777
    b.ImageIndex = 0
    b.ToolTip = "Do not click here."
    b.Visible = True

    Dim i As New System.Windows.Forms.ImageList
    i.Images.Add(Image.FromFile("c:\icons\Zero Suit.ico"))
    i.Images.Add(Image.FromFile("c:\icons\The Other Band.ico"))

    Dim t As New DataDynamics.ActiveReports.Viewer.ToolbarObject
    t.DisplayToolTips = True
    t.Images = i
    t.Tools.AddRange(arr)

    Dim rpt As New rptDD
    rpt.Run()
    arv.Document = rpt.Document
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ToolsCollection Class
ToolsCollection Members

Send Feedback