Framework / Thin Web / Toolbar
In This Topic
    Toolbar
    In This Topic

    The ThinWeb controls (Chart and Diagram) have an integrated toolbar which allows you to perfrom different actions on the control it is attached to. The following sections describe how to configure the toolbar as well as the common button actions you can apply.

     Visibility

    The toolbar visibility is controlled trough the Toolbar Visible property. The following code snippets show the toolbar:

    C#
    Copy Code

    someThinControl.Toolbar.Visible = true;

    Visual Basic
    Copy Code

    someThinControl.Toolbar.Visible = True

     Adding Buttons

    After you make the toolbar visible you can add toolbar buttons to it. Each toolbar button is associated with an action that is performed when the user clicks on that button. The following code snippet adds a toolbar button that exports the current visual representation of the control as PDF:

    C#
    Copy Code

    someThinControl.Toolbar.Items.Add(new NToolbarButton(new NSaveImageAction("Save as PDF", new NPdfImageFormat(), false, new NSize(600, 600), 300)));

    Visual Basic
    Copy Code
     

    someThinControl.Toolbar.Items.Add(New NToolbarButton(new NSaveImageAction("Save as PDF", New NPdfImageFormat(), False, New NSize(600, 600), 300)))

    The control will display toolbar buttons in the order they are added to the Toolbar.Items collection in left to right order.
     Adding Separators

    Sometimes it's useful to group together buttons that perform similar actions (like actions that export an image in a specified format) or actions that toggle the image map tools. In this case you can add toolbar items of type NToolbarSeparator:

    C#
    Copy Code

    someThinControl.Toolbar.Items.Add(new NToolbarSeparator());

    Visual Basic
    Copy Code
     

    someThinControl.Toolbar.Items.Add(New NToolbarSeparator())

     Common Toolbar Actions

    Nevron Chart ThinWeb and Nevron Diagram ThinWeb share a number of common toolbar actions. The following table briefly describes them:

    Type Description
    NSaveStateAction Saves the current control state. Optional parameters are the file name to save the state and the persistency format.
    NSaveImageAction Saves the current control visual representation as an image in the specified format. Optional parameters are the image format, the image size (automatic or manual), resolution and image name.
    NToggleAutoUpdateAction Toggles automatic update on or off depending on the current automatic update settings of the control.
    NToggleTooltipToolAction Toggles the enabled state of the first tool of type NTooltipTool in the controller tools collection.
    NToggleCursorToolAction Toggles the enabled state of the first tool of type NCursorTool in the controller tools collection.
    NToggleBrowserRedirectToolAction Toggles the enabled state of the first tool of type NBrowserRedirectTool in the controller tools collection.

     

     Related Examples

    Nevron Chart\Web Forms\ThinWeb\Toolbar Configuration
    Nevron Chart\Mvc\Toolbar Configuration


    Nevron Diagram\Web Forms\ThinWeb\Toolbar Configuration
    Nevron Diagram\Mvc\Toolbar Configuration