Cursor.Handle 속성

정의

커서의 핸들을 가져옵니다.

public:
 property IntPtr Handle { IntPtr get(); };
public IntPtr Handle { get; }
member this.Handle : nativeint
Public ReadOnly Property Handle As IntPtr

속성 값

IntPtr

nativeint

커서의 핸들을 나타내는 IntPtr입니다.

예외

핸들 값이 Zero인 경우

예제

다음 코드 예제에서는 커서의 Handle에서 커서를 Current 만들고 위치를 변경하고 사각형을 클리핑합니다. 그 결과 코드가 실행될 때 커서가 위쪽 및 왼쪽 50픽셀로 이동합니다. 또한 커서의 클리핑 사각형은 양식의 범위로 변경됩니다(기본적으로 사용자의 전체 화면임). 이 예제에서는 Form 클릭할 때 이 코드를 호출하려면 및 Button 이 필요합니다.

void MoveCursor()
{
   // Set the Current cursor, move the cursor's Position,
   // and set its clipping rectangle to the form.

   this->Cursor = gcnew System::Windows::Forms::Cursor( ::Cursor::Current->Handle );
   ::Cursor::Position = Point(::Cursor::Position.X - 50,::Cursor::Position.Y - 50);
   ::Cursor::Clip = Rectangle(this->Location,this->Size);

}
private void MoveCursor()
{
   // Set the Current cursor, move the cursor's Position,
   // and set its clipping rectangle to the form. 

   this.Cursor = new Cursor(Cursor.Current.Handle);
   Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);
   Cursor.Clip = new Rectangle(this.Location, this.Size);
}
Private Sub MoveCursor()
   ' Set the Current cursor, move the cursor's Position,
   ' and set its clipping rectangle to the form. 

   Me.Cursor = New Cursor(Cursor.Current.Handle)
   Cursor.Position = New Point(Cursor.Position.X - 50, Cursor.Position.Y - 50)
   Cursor.Clip = New Rectangle(Me.Location, Me.Size)
End Sub

설명

핸들의 복사본이 아닙니다. 삭제하지 마세요.

적용 대상

추가 정보