ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Design.Win Assembly / GrapeCity.ActiveReports.Design Namespace / Designer Class / QueryActionChecked Method
DesignerAction Types
Example

In This Topic
    QueryActionChecked Method
    In This Topic
    Queries the object for the checked status of one or more commands.
    Syntax
    'Declaration
     
    Public Function QueryActionChecked( _
       ByVal action As DesignerAction _
    ) As Boolean
    public bool QueryActionChecked( 
       DesignerAction action
    )

    Parameters

    action
    DesignerAction Types

    Return Value

    true if the specified action is checked; otherwise, false. The return value indicates the current state of the action within the designer environment.
    Remarks
    This method is used to query the state of actions that can be toggled on or off within the designer. For example, it can be used to check whether grid alignment is enabled or whether a specific tool is currently active.
    Example
    /// <summary>
    /// SetStatus - Updates a toolbutton's status, based on a designer action
    /// </summary>
    /// <param name="action">DesignerAction to take in string format</param>
    /// <param name="toolButton">ToolButton to update</param>
    private void SetStatus(string action,System.Windows.Forms.ToolBarButton toolButton)
    {
        DesignerAction daAction = GetActionFromString(action);
        //Do the following if the DesignerAction isn't a FileOpen
        if(daAction != DesignerAction.FileOpen)
        {
            //Set toolButton attributes based on the Designer Action
            toolButton.Enabled = this.ardMain.QueryActionEnabled(daAction);
            toolButton.Pushed = this.ardMain.QueryActionChecked(daAction);
        }    
    }
    'SetStatus - Updates a toolbutton's status, based on a designer action
    'Parameter Name: action - DesignerAction to take in string format
    'Parameter Name: toolButton - ToolButton to update
    Private Sub SetStatus(ByVal action As String, ByVal toolButton As System.Windows.Forms.ToolBarButton)
        Dim daAction As DesignerAction = GetActionFromString(action)
        'Do the following if the DesignerAction isn't a FileOpen
        If daAction <> DesignerAction.FileOpen Then
            'Set toolButton attributes based on the Designer Action
            toolButton.Enabled = Me.ardMain.QueryActionEnabled(daAction)
            toolButton.Pushed = Me.ardMain.QueryActionChecked(daAction)
        End If
    End Sub 'SetStatus
    See Also

    Reference

    Designer Class
    Designer Members
    GrapeCity.ActiveReports.Design.Win~GrapeCity.ActiveReports.Design.DesignerAction