Cursor.Clip プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

/** @property */ public static Rectangle get_Clip () /** @property */ public static void set_Clip (Rectangle value)
Cursor のクリッピング四角形を、画面座標で表す Rectangle。

クリップされたカーソルは、クリッピング四角形内だけで移動できます。通常、マウスがキャプチャされている場合にだけ、この操作を実行できます。カーソルが現在クリップされていない場合は、クリッピング四角形には画面全体が含まれます。

Current のカーソルの Handle からカーソルを作成し、その位置とクリッピング四角形を変更するコード例を次に示します。結果として、カーソルはコード実行時の位置から上に 50 ピクセル、左に 50 ピクセルの場所に移動します。さらに、カーソルのクリッピング四角形がフォームの境界に変更されます。既定では、これはユーザーの画面全体です。この例では、Form、およびクリックされたときにこのコードを呼び出す Button が存在する必要があります。
Private Sub MoveCursor() ' If the form's cursor is not the Default cursor, ' set the Current cursor, move the cursor's Position, ' and set its clipping rectangle to the form. If Not Me.Cursor.Equals(Cursors.Default) Then 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 If End Sub
private void MoveCursor() { // If the form's cursor is not the Default cursor, // set the Current cursor, move the cursor's Position, // and set its clipping rectangle to the form. if(!this.Cursor.Equals(Cursors.Default)) { 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); } }
void MoveCursor() { // If the form's cursor is not the Default cursor, // set the Current cursor, move the cursor's Position, // and set its clipping rectangle to the form. if ( !this->Cursor->Equals( Cursors::Default ) ) { 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() { // If the form's cursor is not the Default cursor, // set the Current cursor, move the cursor's Position, // and set its clipping rectangle to the form. if (!(this.get_Cursor().Equals(Cursors.get_Default()))) { this.set_Cursor(new Cursor(get_Cursor().get_Current(). get_Handle())); Cursor.set_Position(new Point(get_Cursor().get_Position(). get_X() - 50, get_Cursor().get_Position().get_Y() - 50)); get_Cursor().set_Clip(new Rectangle(this.get_Location(), this.get_Size())); } } //MoveCursor


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からCursor.Clip プロパティを検索する場合は、下記のリンクをクリックしてください。

- Cursor.Clip プロパティのページへのリンク