ActiveReports 9
RemoveAt Method (ControlCollection)
Example 

The index of the control to be removed.
Removes the control from the collection at the specified index.
Syntax
'Declaration
 
Public Shadows Sub RemoveAt( _
   ByVal index As System.Integer _
) 
public new void RemoveAt( 
   System.int index
)

Parameters

index
The index of the control to be removed.
Example
private void arReport_ReportStart(object sender, System.EventArgs eArgs)
{
    //create an array of controls 
    ARControl[] arr = new ARControl[3]; 
    GrapeCity.ActiveReports.SectionReportModel.CheckBox c = new GrapeCity.ActiveReports.SectionReportModel.CheckBox(); 
    GrapeCity.ActiveReports.SectionReportModel.Label l = new GrapeCity.ActiveReports.SectionReportModel.Label(); 
    GrapeCity.ActiveReports.SectionReportModel.TextBox t = new GrapeCity.ActiveReports.SectionReportModel.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 a control from a specified location 
    this.Sections[0].Controls.RemoveAt(1);
}
Private Sub rptReport_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 GrapeCity.ActiveReports.SectionReportModel.CheckBox
    Dim l As New GrapeCity.ActiveReports.SectionReportModel.Label
    Dim t As New GrapeCity.ActiveReports.SectionReportModel.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 a control from the specified location
    Me.Sections(0).Controls.RemoveAt(1)
End Sub
See Also

Reference

ControlCollection Class
ControlCollection Members

 

 


Copyright © 2016 GrapeCity, inc. All rights reserved

Support Forum