ActiveReports 8
StatusChanged Event
See Also  Example
GrapeCity.ActiveReports.Design.Win.v8 Assembly > GrapeCity.ActiveReports.Design Namespace > Designer Class : StatusChanged Event

Glossary Item Box

This event is raised for each change in the status of the designer actions.

Syntax

Visual Basic (Declaration) 
Public Event StatusChanged As StatusChangedEventHandler
C# 
public event StatusChangedEventHandler StatusChanged

Remarks

Designer actions represent the commands that are typically invoked from UI elements such as a toolbar or a menu. You can use the QueryAction methods to check the status of the changed action and update your custom UI elements.

Example

C#Copy Code
// ardMain_StatusChanged - runs with the status of the Designer has changed
// (button is pressed)

private void ardMain_StatusChanged(object sender, System.EventArgs e)
{
    for(int i=0;i<this.tbAlign.Buttons.Count;i++)
    {
        System.Windows.Forms.ToolBarButton tb = this.tbAlign.Buttons[i];
        if(tb.Tag != null)
        {
            //If Alignment toolbar button is pressed, call SetStatus()
            SetStatus (tb.Tag.ToString(),tb);    
        }
    }
    for(int i=0;i<this.tbFormat.Buttons.Count;i++)
    {
        System.Windows.Forms.ToolBarButton tb = this.tbFormat.Buttons[i];
        if(tb.Tag != null)
        {
            //if Format toolbar button is pressed, call SetStatus()
            SetStatus (tb.Tag.ToString(),tb);    
        }
    }

    //Update Menus and other toolbars
    StatusStandardToolbar();
    UpdateFormatMenus();
}
Visual BasicCopy Code
'ardMain_StatusChanged - runs with the status of the Designer has changed
'(button is pressed)
Private Sub ardMain_StatusChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ardMain.StatusChanged
    Dim i As Integer
    For i = 0 To (Me.tbAlign.Buttons.Count) - 1
        Dim tb As System.Windows.Forms.ToolBarButton = Me.tbAlign.Buttons(i)
        If Not (tb.Tag Is Nothing) Then
            'If Alignment toolbar button is pressed, call SetStatus()
            SetStatus(tb.Tag.ToString(), tb)
        End If
    Next i

    For i = 0 To (Me.tbFormat.Buttons.Count) - 1
        Dim tb As System.Windows.Forms.ToolBarButton = Me.tbFormat.Buttons(i)
        If Not (tb.Tag Is Nothing) Then
            'if Format toolbar button is pressed, call SetStatus()
            SetStatus(tb.Tag.ToString(), tb)
        End If
    Next i

    'Update Menus and other toolbars
    StatusStandardToolbar()
    UpdateFormatMenus()
End Sub 'ardMain_StatusChanged

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also