Control.Contains(Control) Control.Contains(Control) Control.Contains(Control) Control.Contains(Control) Method

정의

지정된 컨트롤이 특정 컨트롤의 자식인지를 나타내는 값을 검색합니다.Retrieves a value indicating whether the specified control is a child of the 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 Control Control

계산할 Control입니다.The Control to evaluate.

반환

지정된 컨트롤이 특정 컨트롤의 자식이면 true이고, 그렇지 않으면 false입니다.true if the specified control is a child of the control; otherwise, false.

예제

되도록 다음 코드 예제는 Label 를 호출 하 여 표시 되는 해당 BringToFront 메서드.The following code example ensures that a Label is visible by calling its BringToFront method. 이 예제를 실행 하려면를 Form 사용 하 여는 Panel 라는 panel1, 및 Label 라는 label1합니다.This example requires that you have a Form with a Panel named panel1, and a Label named 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

적용 대상

추가 정보