SimpleShape.LocationChanged 이벤트
발생할 때의 Location 셰이프의 속성을 변경 합니다.
네임스페이스: Microsoft.VisualBasic.PowerPacks
어셈블리: Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)
구문
‘선언
<BrowsableAttribute(True)> _
Public Event LocationChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler LocationChanged
[BrowsableAttribute(true)]
public:
event EventHandler^ LocationChanged {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member LocationChanged : IEvent<EventHandler,
EventArgs>
JScript에서는 이벤트를 지원하지 않습니다.
설명
이 이벤트는 프로그래밍 방식의 수정이나 사용자의 상호 작용에 의해 Location 속성이 변경될 때 발생합니다.
이벤트를 처리하는 방법에 대한 자세한 내용은 이벤트 사용을 참조하십시오.
예제
다음 예제에서는 이벤트 처리기에서 LocationChanged 이벤트에 응답하는 방법을 보여 줍니다.이 예제에서는 두 대가 필요 RectangleShape 컨트롤 폼에 RectangleShape1 및 RectangleShape2 라는.
Private Sub RectangleShape1_LocationChanged(
) Handles RectangleShape1.LocationChanged
' If the second rectangle intersects with the first, move it.
If RectangleShape1.ClientRectangle.IntersectsWith(
RectangleShape2.ClientRectangle) Then
RectangleShape2.Location = New Point(RectangleShape1.Right,
RectangleShape1.Bottom)
End If
End Sub
private void rectangleShape1_LocationChanged(object sender, System.EventArgs e)
{
// If the second rectangle intersects with the first, move it.
if (rectangleShape1.ClientRectangle.IntersectsWith(rectangleShape2.ClientRectangle))
{
rectangleShape2.Location = new Point(rectangleShape1.Right,
rectangleShape1.Bottom);
}
}
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.
참고 항목
참조
Microsoft.VisualBasic.PowerPacks 네임스페이스
기타 리소스
Line 및 Shape 컨트롤 소개(Visual Studio)
방법: LineShape 컨트롤로 선 그리기(Visual Studio)
방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)