ActiveReports Developer 7
QueryActionEnabled Method
See Also  Example
GrapeCity.ActiveReports.Design.Win.v7 Assembly > GrapeCity.ActiveReports.Design Namespace > Designer Class : QueryActionEnabled Method

action
DesignerAction Types

Glossary Item Box

Queries the object for the enabled status of one or more commands.

Syntax

Visual Basic (Declaration) 
Public Function QueryActionEnabled( _
   ByVal action As DesignerAction _
) As System.Boolean
C# 
public System.bool QueryActionEnabled( 
   DesignerAction action
)

Parameters

action
DesignerAction Types

Return Value

True, if the enabled status is true, else False.

Example

C#Copy Code
/// <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);
    }    
}
Visual BasicCopy Code
'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