Control.Contains(Control) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Recupera um valor que indica se o controlo especificado é filho do controlo.
public:
bool Contains(System::Windows::Forms::Control ^ ctl);
public bool Contains(System.Windows.Forms.Control ctl);
member this.Contains : System.Windows.Forms.Control -> bool
Public Function Contains (ctl As Control) As Boolean
Parâmetros
Devoluções
true se o controlo especificado for filho do controlo; caso contrário, false.
Exemplos
O seguinte exemplo de código garante que a Label é visível ao chamar o seu BringToFront método. Este exemplo exige que tenhas um Form com um Panel nome panel1, e um Labellabel1nome .
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();
}
}
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