ActiveReports.Viewer3 Request technical support
Toolbar Class
See Also  Members   Example 


Represents the viewer control's toolbar.

Object Model


Syntax

Visual Basic (Declaration) 
Public Class Toolbar 
   Inherits UserControl
Visual Basic (Usage)Copy Code
Dim instance As Toolbar
C# 
public class Toolbar : UserControl 

Example

C#Copy Code
private void arv_Load(object sender, System.EventArgs e)
{
   
//create a new button
   
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;

   
//create a new image list
   
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 new toolbar
   
DataDynamics.ActiveReports.Toolbar.Toolbar t = new DataDynamics.ActiveReports.Toolbar.Toolbar();
   t.DisplayToolTips = true;
   t.Images = i;
   t.Parent = arv.Parent;
   t.Tools.Add(b);
   t.Wrappable = true;

   rptDD rpt =
new rptDD();
   rpt.Run();
   arv.Document = rpt.Document;
}
Visual BasicCopy Code
Private Sub arv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arv.Load
    'create a new button
    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

    'create a new image list
    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 new toolbar
    Dim t As New DataDynamics.ActiveReports.Toolbar.Toolbar
    t.DisplayToolTips = True
    t.Images = i
    t.Parent = arv.Parent
    t.Tools.Add(b)
    t.Wrappable = True

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

Remarks

Note:  In order to enable the Viewer's Copy button, you will need to add references to the RtfExport.dll and the TextExport.dll.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            System.Windows.Forms.ScrollableControl
               System.Windows.Forms.ContainerControl
                  System.Windows.Forms.UserControl
                     DataDynamics.ActiveReports.Toolbar.Toolbar
                        DataDynamics.ActiveReports.Viewer.ViewerToolbar

See Also