ActiveReports 8
Contains Method
See Also  Example
GrapeCity.ActiveReports.v8 Assembly > GrapeCity.ActiveReports.SectionReportModel Namespace > ControlCollection Class : Contains Method

control
The control to locate in the collection.

Glossary Item Box

Determines whether the specified control is a member of the collection.

Syntax

Visual Basic (Declaration) 
Public Function Contains( _
   ByVal control As ARControl _
) As System.Boolean
C# 
public System.bool Contains( 
   ARControl control
)

Parameters

control
The control to locate in the collection.

Return Value

Boolean.  Returns True if the control is a member of the collection; otherwise, False.

Example

C#Copy Code
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);

    if (this.Sections[0].Controls.Contains(t)) 
    { 
        System.Windows.Forms.MessageBox.Show("t"); 
    }
}
Visual BasicCopy Code
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)
    If Me.Sections(0).Controls.Contains(t) Then
        MessageBox.Show("t")
    End If
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