ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / ZoomChanged Event
Example

In This Topic
    ZoomChanged Event (Viewer)
    In This Topic
    Occurs when the zoom level of the viewer changes.
    Syntax
    'Declaration
     
    Public Event ZoomChanged As ZoomChangedEventHandler
    public event ZoomChangedEventHandler ZoomChanged
    Event Data

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

    PropertyDescription
    Gets the new zoom value of the viewer.  
    Remarks
    The ZoomChangedEventArgs provides the new zoom level. Handlers for this event can respond to zoom level changes, for example, by updating UI elements that reflect the current zoom level.
    Example
    public partial class MyForm : Form
    {
    	private Viewer viewer;
    	public MyForm()
    	{
    		InitializeComponent();
    		// Initialize the viewer
    		viewer = new Viewer();
    		this.Controls.Add(viewer);
    		// Subscribe to the ZoomChanged event
    		viewer.ZoomChanged += Viewer_ZoomChanged;
    	}
    	private void Viewer_ZoomChanged(object sender, EventArgs e)
    	{
    		// Handle the ZoomChanged event
    		// For example, update the status bar with the current zoom level
    		statusBarLabel.Text = $"Zoom: {viewer.Zoom}%";
    	}
    }
    See Also