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

Glossary Item Box

Raised when the selection changes.

Syntax

Visual Basic (Declaration) 
Public Event SelectionChanged As SelectionChangedEventHandler
C# 
public event SelectionChangedEventHandler SelectionChanged

Remarks

You can use the Selection property to inspect the current selection.

Example

C#Copy Code
// ardMain_SelectionChanged - runs when a control/section in the layout is selected

private void ardMain_SelectionChanged()
{
    //Update the property grid with the new control/section properties
    this.SelChangePropGrid();
            
    if(this._controlAdded)  //Control is newly added
    {
        //Add item to ComboBox and PropGrid
        this._isCboDirty = true;
        this._controlAdded = false;
    }
        
    if(this._controlDeleted)  //Control is newly deleted
    {
        this._isCboDirty = true;
    }

    if(this._sectionAdded)  //Section is newly added
    {
        this._isCboDirty = true;
    }

    if(this._sectionDeleted)  //Section is newly deleted
    {
        this._isCboDirty = true;
    }
}
Visual BasicCopy Code
'ardMain_SelectionChanged - runs when a control/section in the layout is selected
Private Sub ardMain_SelectionChanged() Handles ardMain.SelectionChanged
    'Update the property grid with the new control/section properties
    Me.SelChangePropGrid()

    If Me._controlAdded Then 'Control is newly added
        'Add item to ComboBox and PropGrid
        Me._isCboDirty = True
        Me._controlAdded = False
    End If

    If Me._controlDeleted Then 'Control is newly deleted
        Me._isCboDirty = True
    End If

    If Me._sectionAdded Then 'Section is newly added
        Me._isCboDirty = True
    End If

    If Me._sectionDeleted Then 'Section is newly deleted
        Me._isCboDirty = True
    End If
End Sub 'ardMain_SelectionChanged

See Also