다음을 통해 공유


SimpleShape.BackgroundImageLayoutChanged 이벤트

발생할 때의 BackgroundImageLayout 셰이프의 속성을 변경 합니다.

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

구문

‘선언
<BrowsableAttribute(True)> _
Public Event BackgroundImageLayoutChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler BackgroundImageLayoutChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ BackgroundImageLayoutChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member BackgroundImageLayoutChanged : IEvent<EventHandler,
    EventArgs>
JScript에서는 이벤트를 지원하지 않습니다.

설명

이 이벤트는 프로그래밍 방식의 수정이나 사용자의 상호 작용에 의해 BackgroundImageLayout 속성이 변경될 때 발생합니다.

이벤트를 처리하는 방법에 대한 자세한 내용은 이벤트 사용을 참조하십시오.

예제

다음 예제에서는 이벤트 처리기에서 BackgroundImageLayoutChanged 이벤트에 응답하는 방법을 보여 줍니다.이 예제에서는 사용자가 있어야는 RectangleShape 폼에 RectangleShape1 이라는 컨트롤입니다.

Private Sub RectangleShape1_BackgroundImageLayoutChanged(
  ) Handles RectangleShape1.BackgroundImageLayoutChanged

    ' If the image is centered, check its size.
    If RectangleShape1.BackgroundImageLayout = ImageLayout.Center Then
        Dim imageSize As SizeF
        imageSize = RectangleShape1.BackgroundImage.PhysicalDimension
        ' If the image is smaller than the shape, change the BackColor.
        If imageSize.Height < RectangleShape1.ClientSize.Height OrElse
          imageSize.Width < RectangleShape1.ClientSize.Width Then
            RectangleShape1.BackColor = Color.Black
        End If
    End If
End Sub
private void rectangleShape1_BackgroundImageLayoutChanged(object sender, 
    System.EventArgs e)
{
    // If the image is centered, check its size.
    if (rectangleShape1.BackgroundImageLayout == ImageLayout.Center)
    {
        SizeF imageSize;
        imageSize = rectangleShape1.BackgroundImage.PhysicalDimension;
        // If the image is smaller than the shape, change the BackColor.
        if (imageSize.Height < rectangleShape1.ClientSize.Height || 
            imageSize.Width < rectangleShape1.ClientSize.Width)
        {
            rectangleShape1.BackColor = Color.Black;
        }
    }
}

.NET Framework 보안

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

참고 항목

참조

SimpleShape 클래스

Microsoft.VisualBasic.PowerPacks 네임스페이스

기타 리소스

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

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

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