ActiveReports.Viewer3 Request technical support
ToolClick Event
See Also  Example


Occurs when a tool on the toolbar is clicked.

Syntax

Visual Basic (Declaration) 
Public Event ToolClick() As ToolClickEventHandler
Visual Basic (Usage)Copy Code
Dim instance As Toolbar
Dim handler As ToolClickEventHandler
 
AddHandler instance.ToolClick, handler
C# 
public event ToolClickEventHandler ToolClick()

Event Data

The event handler receives an argument of type ToolClickEventArgs containing data related to this event. The following ToolClickEventArgs properties provide information specific to this event.

PropertyDescription
Tool Gets or sets the tool that was clicked.

Example

C#Copy Code
private void arViewer_ToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
{
   
//Add code to run when new buttons are clicked
   
try
   {
       
switch(e.Tool.Id)
       {
           
case 5001: //Save button
               
this.SaveDocument();
               
break;
           
case 5002: //Export button
               
this.ExportDocument();
               
break;
       }
   }
   
catch(System.IO.IOException exp)
   {
       MessageBox.Show(exp.ToString());
   }
}
Visual BasicCopy Code
Private Sub arViewer_ToolClick(ByVal sender As Object, ByVal e As Toolbar.ToolClickEventArgs) Handles arvMain.ToolClick
    'Add code to run when new buttons are clicked
    Try
        Select Case e.Tool.Id
            Case 5001 'Save button
                Me.SaveDocument()
            Case 5002 'Export button
                Me.ExportDocument()
        End Select
    Catch exp As System.IO.IOException
        MessageBox.Show(exp.ToString())
    End Try
End Sub 'arViewer_ToolClick

See Also