See Also

ControlCollection Class  | ControlCollection Members

Language

Visual Basic

C#

Show All

index

The index in the collection from which the control should be removed.

See Also Languages ActiveReports Send feedback to Data Dynamics

RemoveAt Method

Removes the control at the specified index from the control collection.

[Visual Basic]
Public Sub RemoveAt( _    ByVal index As Integer _ )
[C#]
public void RemoveAt(    int index );

Parameters

index

The index in the collection from which the control should be removed.

Remarks

Note: Controls added to the designer come before dynamically added controls in the array.

Example

[C#] 

private void rptDataDynamics_ReportStart(object sender, System.EventArgs eArgs) 

    //create an array of controls 
    ARControl[] arr = new ARControl[3]; 
    DataDynamics.ActiveReports.CheckBox c = new DataDynamics.ActiveReports.CheckBox(); 
    DataDynamics.ActiveReports.Label l = new DataDynamics.ActiveReports.Label(); 
    DataDynamics.ActiveReports.TextBox t = new DataDynamics.ActiveReports.TextBox(); 
    //set some properties for the controls 
    c.Text = "Checkbox"; 
    l.Left = 1; 
    l.Value = "LabelValue"; 
    t.Left = 2; 
    t.Text = "TextBox"; 
    //assign the controls to the array 
    arr[0] = c; 
    arr[1] = l; 
    arr[2] = t; 
    //add the range of controls to the first section of the report 
    this.Sections[0].Controls.AddRange(arr); 
    //remove the checkbox 
    this.Sections[0].Controls.RemoveAt(0); 
}

[Visual Basic] 

Private Sub rptDD_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart
    'create an array of controls
    Dim arr(2) As ARControl
    Dim c As New DataDynamics.ActiveReports.CheckBox
    Dim l As New DataDynamics.ActiveReports.Label
    Dim t As New DataDynamics.ActiveReports.TextBox
    'set some properties for the controls
    c.Text = "Checkbox"
    l.Left = 1
    l.Text = "Label"
    t.Left = 2
    t.Text = "TextBox"
    'assign the controls to the array
    arr(0) = c
    arr(1) = l
    arr(2) = t
    'add the range of controls to the first section of the report
    Me.Sections(0).Controls.AddRange(arr)
    'remove the third control
    Me.Sections(0).Controls.RemoveAt(2)
End Sub

See Also

ControlCollection Class  | ControlCollection Members

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.