Shape.MouseWheel 이벤트
해당 마우스 휠이 움직이고 도형에 포커스가 있을 때 발생 합니다.
네임스페이스: Microsoft.VisualBasic.PowerPacks
어셈블리: Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)
구문
‘선언
<BrowsableAttribute(True)> _
Public Event MouseWheel As MouseEventHandler
[BrowsableAttribute(true)]
public event MouseEventHandler MouseWheel
[BrowsableAttribute(true)]
public:
event MouseEventHandler^ MouseWheel {
void add (MouseEventHandler^ value);
void remove (MouseEventHandler^ value);
}
[<BrowsableAttribute(true)>]
member MouseWheel : IEvent<MouseEventHandler,
MouseEventArgs>
JScript에서는 이벤트를 지원하지 않습니다.
설명
처리 하는 경우는 MouseWheel 이벤트를 마우스 휠과 관련 된 사용자 인터페이스 (UI) 표준을 따라야 합니다.Delta 속성 값은 마우스 휠을 움직인 정도를 나타냅니다.UI는 누적된 델타가 +120 또는 -120일 때 스크롤해야 합니다.UI는 도달한 모든 델타 값에 대해 MouseWheelScrollLines 속성에서 반환된 논리 줄 수를 스크롤해야 합니다.또한 120 단위 간격 보다 작은 사용 하 여 보다 부드럽게 스크롤할 수 있습니다.그러나, 비율, 일정 하 게 유지 해야 합니다 MouseWheelScrollLines 줄 당 휠 움직임의 120 델타 단위로 스크롤됩니다.
마우스 이벤트는 다음 순서대로 발생합니다.
MouseHover / MouseDown / MouseWheel
이벤트를 처리하는 방법에 대한 자세한 내용은 이벤트 사용을 참조하십시오.
예제
다음 예제에서는 사용 하는 방법을 보여 줍니다.는 MouseWheel 를 이벤트는 RectangleShape 컨트롤.이 예제에서는 사용자가 있어야는 RectangleShape 폼에 RectangleShape1 이라는 컨트롤입니다.
Private Sub RectangleShape1_MouseWheel(
ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs
) Handles RectangleShape1.MouseWheel
' Move the shape vertically to correspond to the scrolling of the
' mouse wheel.
Dim scale As Integer = e.Delta *
SystemInformation.MouseWheelScrollLines / 120
RectangleShape1.Top = RectangleShape1.Top - scale
End Sub
private void rectangleShape1_MouseWheel(object sender,
System.Windows.Forms.MouseEventArgs e)
{
// Move the shape vertically to correspond to the scrolling of the
// mouse wheel.
int scale = e.Delta * SystemInformation.MouseWheelScrollLines / 120;
rectangleShape1.Top = rectangleShape1.Top - scale;
}
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.
참고 항목
참조
Microsoft.VisualBasic.PowerPacks 네임스페이스
기타 리소스
방법: LineShape 컨트롤로 선 그리기(Visual Studio)
방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)