Control.Contains(Control) 메서드

정의

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

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

매개 변수

ctl
Control

평가할 값입니다 Control .

반품

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

적용 대상

추가 정보