ActiveReports.Viewer3 Request technical support
Tools Property
See Also  Example


Gets a reference to the toolbar's tools.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Tools As ToolsCollection
Visual Basic (Usage)Copy Code
Dim instance As ToolbarObject
Dim value As ToolsCollection
 
value = instance.Tools
C# 
public ToolsCollection Tools {get;}

Return Value

A ToolsCollection value that contains the toolbar's tools.

Example

C#Copy Code
private void arv_Load(object sender, System.EventArgs e)
{
   
//run a report and display it in the viewer
   
rptDD rpt = new rptDD();
   rpt.Run();
   arv.Document = rpt.Document;

   
//create an array of tools
   
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;

   DataDynamics.ActiveReports.Toolbar.CheckButton c =
new DataDynamics.ActiveReports.Toolbar.CheckButton();
   c.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon;
   c.Id = 888;
   c.ImageIndex = 1;
   c.ToolTip =
"Click here.";

   arr[0] = b;
   arr[1] = c;

   
//create a context menu
   
System.Windows.Forms.ContextMenu cm = new ContextMenu();
   cm.MenuItems.Add(
"Hide");

   
//create a font
   
System.Drawing.Font f = new Font("Times New Roman", 12);

   
//create an imagelist
   
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"));

   
//create a toolbar
   
DataDynamics.ActiveReports.Toolbar.Toolbar t = new DataDynamics.ActiveReports.Toolbar.Toolbar();
   t.ContextMenu = cm;
   t.DisplayToolTips = true;
   t.Enabled = true;
   t.Font = f;
   t.Images = i;
   t.Parent = arv.Parent;
   t.Tools.AddRange(arr);
   t.Visible = true;
   t.Wrappable = true;    
}
Visual BasicCopy Code
Private Sub arv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arv.Load
    'run a report and display it in the viewer
    Dim rpt As New rptDD
    rpt.Run()
    arv.Document = rpt.Document

    'create an array of tools
    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 c As New DataDynamics.ActiveReports.Toolbar.CheckButton
    c.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon
    c.Id = 888
    c.ImageIndex = 1
    c.ToolTip = "Click here."

    arr(0) = b
    arr(1) = c

    'create a context menu
    Dim cm As New ContextMenu
    cm.MenuItems.Add("Hide")

    'create a font
    Dim f As New Font("Times New Roman", 12)

    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"))

    'create a toolbar
    Dim t As New DataDynamics.ActiveReports.Toolbar.Toolbar
    t.ContextMenu = cm
    t.DisplayToolTips = True
    t.Enabled = True
    t.Font = f
    t.Images = i
    t.Parent = arv.Parent
    t.Tools.AddRange(arr)
    t.Visible = True
    t.Wrappable = True
End Sub

Remarks

You can use this property to customize the tools on the toolbar using the Add and Remove methods.

See Also