ActiveReports3 Request technical support
IndexOf Method
See Also  Example


control
The control to locate in the collection.
Retrieves the index of the specified control in the control collection.

Syntax

Visual Basic (Declaration) 
Public Function IndexOf( _
   ByVal control As ARControl _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As ControlCollection
Dim control As ARControl
Dim value As Integer
 
value = instance.IndexOf(control)
C# 
public 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

C#Copy Code
private void rptDataDynamics_ReportStart(object sender, System.EventArgs eArgs)
{
   DataDynamics.ActiveReports.TextBox t =
new DataDynamics.ActiveReports.TextBox();
   t.Text=
"Insert text here.";
   
this.Sections[0].Controls.Add (t);
   System.Windows.Forms.MessageBox.Show (
this.Sections[0].Controls.IndexOf(t).ToString());
}
Visual BasicCopy Code
Private Sub rptDD_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart
    Dim t As New DataDynamics.ActiveReports.TextBox
    t.Text = "Insert text here."
    Me.Sections(0).Controls.Add(t)
    MessageBox.Show(Me.Sections(0).Controls.IndexOf(t))
End Sub

See Also