ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / GetShortcutCommands Method
Example

In This Topic
    GetShortcutCommands Method
    In This Topic
    Retrieves a collection of keyboard shortcuts configured for the viewer.
    Syntax
    'Declaration
     
    Public Function GetShortcutCommands() As IEnumerable(Of ViewerShortcut)
    public IEnumerable<ViewerShortcut> GetShortcutCommands()

    Return Value

    A collection of ViewerShortcut objects, each representing a keyboard shortcut configured for various viewer actions.
    Exceptions
    ExceptionDescription
    Thrown if the internal storage for toolbar shortcuts is not initialized, indicating a configuration or initialization error within the viewer.
    Remarks
    This method provides access to the viewer's keyboard shortcuts, allowing external components or applications to display, customize, or respond to these shortcuts. It is essential for enhancing user accessibility and efficiency when interacting with the viewer.
    Example
    // Assuming 'viewer' is an instance of Viewer.
    // Retrieving the list of shortcut commands available in the viewer.
    var shortcutCommands = viewer.GetShortcutCommands();
    foreach (var command in shortcutCommands)
    {
        Console.WriteLine($"Command: {command.Command}, Enabled: {command.Enabled}");
    }
    See Also