다음을 통해 공유


Shape.FindForm 메서드

선 또는 도형 컨트롤이 들어 있는 폼을 검색 합니다.

네임스페이스:  Microsoft.VisualBasic.PowerPacks
어셈블리:  Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)

구문

‘선언
Public Function FindForm As Form
public Form FindForm()
public:
Form^ FindForm()
member FindForm : unit -> Form 
public function FindForm() : Form

반환 값

형식: System.Windows.Forms.Form
컨트롤이 들어 있는 Form입니다.

설명

컨트롤의 Parent 속성 값 수와 같은 Form 에서 반환 하는 FindForm 메서드.도형 또는 선 컨트롤의 부모를 항상 되는 ShapeContainer, 및 ShapeContainer 컨테이너 컨트롤에 포함 될 수 있습니다.예는 것이 좋습니다는 LineShape 컨트롤에 포함 된는 GroupBox 제어 하는 GroupBoxForm.In this example, the control's Parent is a ShapeContainer, the ShapeContainer object's Parent is a GroupBox, and the GroupBox control's Parent is the Form.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 있는 FindForm 메서드는 양식에 포함 되어 있는지 확인 하는 LineShape 컨트롤.

Private Sub GetTheForm()
    Dim myForm As Form = LineShape1.FindForm()
    ' Set the text and color of the form that contains the LineShape.
    myForm.Text = "This form contains a line"
    myForm.BackColor = Color.Red
End Sub
private void GetTheForm()
{
    Form myForm = lineShape1.FindForm();
    // Set the text and color of the form that contains the LineShape.
    myForm.Text = "This form contains a line";
    myForm.BackColor = Color.Red;
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Shape 클래스

Microsoft.VisualBasic.PowerPacks 네임스페이스

기타 리소스

방법: LineShape 컨트롤로 선 그리기(Visual Studio)

방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)

Line 및 Shape 컨트롤 소개(Visual Studio)