ActiveReports 9
IndexOf Method (ControlCollection)
Example 

The control to locate in the collection.
Retrieves the index of the specified control in the control collection.
Syntax
'Declaration
 
Public Function IndexOf( _
   ByVal control As ARControl _
) As System.Integer
public System.int IndexOf( 
   ARControl control
)

Parameters

control
The control to locate in the collection.

Return Value

A zero-based value that represents the position of the specified control in the collection.
Example
private void SectionReport1_ReportStart(object sender, System.EventArgs eArgs)
{
    GrapeCity.ActiveReports.SectionReportModel.TextBox t = new GrapeCity.ActiveReports.SectionReportModel.TextBox();
    t.Text="Insert text here.";
    this.Sections[0].Controls.Add (t);
    System.Windows.Forms.MessageBox.Show (this.Sections[0].Controls.IndexOf(t).ToString()); 
}
Private Sub SectionReport1_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart
    Dim t As New GrapeCity.ActiveReports.SectionReportModel.TextBox
    t.Text = "Insert text here."
    Me.Sections(0).Controls.Add(t)
    MessageBox.Show(Me.Sections(0).Controls.IndexOf(t))
End Sub
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

Reference

ControlCollection Class
ControlCollection Members

 

 


Copyright © 2014 GrapeCity, inc. All rights reserved

Support Forum