Cursor.Equals(Object) 메서드

정의

커서가 지정된 Cursor와 같은지 여부를 나타내는 값을 반환합니다.Returns a value indicating whether this cursor is equal to the specified Cursor.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object? obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

매개 변수

obj
Object

비교할 Cursor입니다.The Cursor to compare.

반환

Boolean

이 커서가 지정된 Cursor와 같으면 true이고, 그렇지 않으면 false입니다.true if this cursor is equal to the specified Cursor; otherwise, false.

예제

다음 코드 예제에서는 커서의 커서를 만들어 Current Handle 위치와 클리핑 사각형을 변경 합니다.The following code example creates a cursor from the Current cursor's Handle, changes its position and clipping rectangle. 그러면 커서가 코드를 실행 하는 위치에서 왼쪽 50 픽셀로 이동 됩니다.The result is the cursor will move up and to the left 50 pixels from where it is when the code is executed. 또한 커서의 클리핑 사각형은 폼의 범위 (기본적으로 사용자의 전체 화면)로 변경 됩니다.Additionally, the cursor's clipping rectangle is changed to the bounds of the form (by default it is the user's whole screen). 이 예제를 Form Button 클릭 하면이 코드를 호출 하기 위해 및가 필요 합니다.This example requires a Form and a Button to call this code when it is clicked.

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

적용 대상