Control.Contains(Control) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 컨트롤이 컨트롤의 자식인지 여부를 나타내는 값을 검색합니다.
public:
bool Contains(System::Windows::Forms::Control ^ ctl);
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
매개 변수
반품
true지정된 컨트롤이 컨트롤의 자식이면 이고, 그렇지 않으면 . false
예제
다음 코드 예제에서는 메서드를 호출 Label 하여 표시 BringToFront 되도록 합니다. 이 예제에서는 FormPanel 명명된 이름 및 panel1 이름이 Labellabel1있는 이름이 있어야 합니다.
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