Cursor.Clip 속성

정의

커서의 클리핑 사각형을 나타내는 범위를 가져오거나 설정합니다.

public:
 static property System::Drawing::Rectangle Clip { System::Drawing::Rectangle get(); void set(System::Drawing::Rectangle value); };
public static System.Drawing.Rectangle Clip { get; set; }
member this.Clip : System.Drawing.Rectangle with get, set
Public Shared Property Clip As Rectangle

속성 값

Rectangle

화면 좌표에서 Cursor에 대한 클리핑 사각형을 나타내는 Rectangle입니다.

예제

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

설명

잘린 커서는 클리핑 사각형 내에서만 이동할 수 있습니다. 일반적으로 시스템은 마우스가 현재 캡처된 경우에만 이를 허용합니다. 커서가 현재 잘리지 않으면 결과 사각형에 전체 화면의 크기가 포함됩니다.

적용 대상