Control.Contains(Control) 메서드

정의

지정된 컨트롤이 특정 컨트롤의 자식인지를 나타내는 값을 검색합니다.

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

매개 변수

ctl
Control

계산할 Control입니다.

반환

Boolean

지정된 컨트롤이 특정 컨트롤의 자식이면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 메서드 BringToFront 를 호출하여 표시 Label 되도록 합니다. 이 예제에서는 Form Panel 명명 panel1Label 된 이름과 이름이 label1있어야 합니다.

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

적용 대상

추가 정보