Retrieves a value indicating whether the specified control is a child of the control.
Public Function Contains ( _ ctl As Control _ ) As Boolean
Dim instance As Control Dim ctl As Control Dim returnValue As Boolean returnValue = instance.Contains(ctl)
public bool Contains( Control ctl )
public: bool Contains( Control^ ctl )
public function Contains( ctl : Control ) : boolean
The following code example ensures that a Label is visible by calling its BringToFront method. This example requires that you have a Form with a Panel named panel1, and a Label named label1.
Private Sub MakeLabelVisible() ' If the panel contains label1, bring it ' to the front to make sure it is visible. If panel1.Contains(label1) Then label1.BringToFront() End If End Sub
private void MakeLabelVisible() { /* If the panel contains label1, bring it * to the front to make sure it is visible. */ if(panel1.Contains(label1)) { label1.BringToFront(); } }
private: void MakeLabelVisible() { /* If the panel contains label1, bring it * to the front to make sure it is visible. */ if ( panel1->Contains( label1 ) ) { label1->BringToFront(); } }
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98