다음을 통해 공유


Shape.Show 메서드

도형을 표시 하는 예제입니다.

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

구문

‘선언
Public Sub Show
public void Show()
public:
void Show()
member Show : unit -> unit 
public function Show()

설명

컨트롤을 표시하려면 Visible 속성을 true로 설정합니다.후는 Show 메서드를 호출할는 Visible 속성의 값을 반환 합니다 true 까지 있는 Hide 메서드를 호출할 때까지 Visible 로 설정 됩니다 false.

예제

다음 예제에서는 Show 및 Hide 실행 시간에 서로 다른 두 도형 간을 전환 하는 방법.이 예제에서는 있어야는 RectangleShape RectangleShape1 이라는 컨트롤 하는 OvalShape 폼에 OvalShape1 이라는 컨트롤.최상의 결과 얻으려면 두 컨트롤 모두 같은 크기로 하 고 맨 위에 다른 하나를 놓습니다.

Private Sub Form1_Load() Handles MyBase.Load
    ' Hide the oval.
    OvalShape1.Hide()
End Sub

Private Sub Shapes_Click() Handles RectangleShape1.Click, 
                                   OvalShape1.Click

    If OvalShape1.Visible = True Then
        ' Hide the oval.
        OvalShape1.Hide()
        ' Show the rectangle.
        RectangleShape1.Show()
    Else
        ' Hide the rectangle.
        RectangleShape1.Hide()
        ' Show the oval.
        OvalShape1.Show()
    End If
End Sub
private void Form1_Load(System.Object sender, System.EventArgs e)
{
    // Hide the oval.
    ovalShape1.Hide();
}

private void Shapes_Click(System.Object sender, System.EventArgs e)
{
    if (ovalShape1.Visible == true)
    // Hide the oval.
    {
        ovalShape1.Hide();
        // Show the rectangle.
        rectangleShape1.Show();
    }
    else
    {
        // Hide the rectangle.
        rectangleShape1.Hide();
        // Show the oval.
        ovalShape1.Show();
    }
}

.NET Framework 보안

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

참고 항목

참조

Shape 클래스

Microsoft.VisualBasic.PowerPacks 네임스페이스

기타 리소스

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

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

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