Cursor.Handle Özellik

Tanım

İmlecin tutamacını alır.

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

Özellik Değeri

IntPtr

nativeint

IntPtr İmlecin tutamacını temsil eden bir.

Özel durumlar

Tanıtıcı değeri şeklindedir Zero.

Örnekler

Aşağıdaki kod örneği, imlecin konumundan Current bir imleç Handleoluşturur, konumunu ve kırpma dikdörtgenini değiştirir. Sonuç olarak imleç, kod yürütürken bulunduğu yerden 50 piksel yukarı ve sola hareket eder. Ayrıca, imlecin kırpma dikdörtgeni formun sınırlarına değiştirilir (varsayılan olarak kullanıcının tüm ekranıdır). Bu örnek tıklandığında bu kodu çağırmak için ve FormButton gerektirir.

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

Açıklamalar

Bu, tanıtıcının bir kopyası değildir; atmayın.

Şunlara uygulanır

Ayrıca bkz.