Cursor Clip Property (System Windows Forms)

  • Upload
    garyo

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

  • 8/2/2019 Cursor Clip Property (System Windows Forms)

    1/4

    ursor.Clip Property (System.Windows.Forms)

    le:///C|/Documents%20and%20Settings/Dear-U...Clip%20Property%20(System_Windows_Forms).htm (1 of 4) [2009/08/08 04:32:50 .

    .NET Framework Developer Center

    Printer Friendly Version Add To Favorites Send Add

    ontent...

    witch on low bandwidth view

    United States - English

    Home Library Learn Downloads Support Community Forums

    La LanguageFilter

    Microsoft.com WelcomeSign

    in

    MSDN MSDN Library .NET Development

    NET Framework 3.5 .NET Framework Class Library System.Windows.Forms Namespace Cursor Class

    Cursor Properties Clip Property

    C CollapseAll

    Microsoft Visual Studio 2008/.NETFramework 3.5

    NET Framework Class Library

    Cursor.Clip Property

    MSDN Library

    This page is specific to

    Other versions are also available fothe following:

    Microsoft Visual Studio

    2003/.NET Framework 1.1

    Microsoft Visual Studio

    2005/.NET Framework 2.0

    .NET Framework 3.0

    Microsoft Visual Studio

    2010/.NET Framework 4.0

    amespace: System.Windows.Formsssembly: System.Windows.Forms (in System.Windows.Forms.dll)

    Click to Rate and GiveFeedback

    ets or sets the bounds that represent the clipping rectangle for the

    ursor.

    Syntax

    Visual Basic (Declaration)

    Visual Basic (Usage)

    PublicSharedProperty Clip As Rectangle

    Dim value As Rectangle

    value = Cursor.Clip

    Cursor.Clip = value

    mit QWeb

    http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(printer).aspxmailto:?subject=Cursor.Clip%20Property%20%20(System.Windows.Forms)&body=This%20URL%20points%20to%20a%20page%20on%20MSDN%20that%20may%20interest%20you:%20http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspxhttp://msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnewhttp://msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnewhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(loband).aspxhttp://void%280%29/http://msdn.microsoft.com/en-us/netframework/default.aspxhttp://msdn.microsoft.com/en-us/library/aa139615.aspxhttp://msdn.microsoft.com/en-us/netframework/aa663309.aspxhttp://msdn.microsoft.com/en-us/netframework/aa569263.aspxhttp://msdn.microsoft.com/en-us/netframework/bb545029.aspxhttp://msdn.microsoft.com/en-us/netframework/aa569258.aspxhttp://social.msdn.microsoft.com/Forums/en-US/category/netdevelopmenthttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspx#Mtps_DropDownFilterTexthttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspx#Mtps_DropDownFilterTexthttp://www.microsoft.com/https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1249713196&rver=6.0.5276.0&wp=MCLBI&wlcxt=msdn%24msdn%24msdn&wreply=http:%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.windows.forms.cursor.clip.aspx&lc=1033&id=254354https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1249713196&rver=6.0.5276.0&wp=MCLBI&wlcxt=msdn%24msdn%24msdn&wreply=http:%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.windows.forms.cursor.clip.aspx&lc=1033&id=254354http://msdn.microsoft.com/en-us/ms348103.aspxhttp://msdn.microsoft.com/en-us/library/ms123401.aspxhttp://msdn.microsoft.com/en-us/library/aa139615.aspxhttp://msdn.microsoft.com/en-us/library/w0x726c2.aspxhttp://msdn.microsoft.com/en-us/library/ms229335.aspxhttp://msdn.microsoft.com/en-us/library/k50ex0x9.aspxhttp://msdn.microsoft.com/en-us/library/sf27z138.aspxhttp://msdn.microsoft.com/en-us/library/db1k3b98.aspxhttp://msdn.microsoft.com/en-us/library/ms123401.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.71).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.71).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.100).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.100).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.100).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.100).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.71).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(VS.71).aspxhttp://msdn.microsoft.com/en-us/library/ms123401.aspxhttp://msdn.microsoft.com/en-us/library/db1k3b98.aspxhttp://msdn.microsoft.com/en-us/library/sf27z138.aspxhttp://msdn.microsoft.com/en-us/library/k50ex0x9.aspxhttp://msdn.microsoft.com/en-us/library/ms229335.aspxhttp://msdn.microsoft.com/en-us/library/w0x726c2.aspxhttp://msdn.microsoft.com/en-us/library/aa139615.aspxhttp://msdn.microsoft.com/en-us/library/ms123401.aspxhttp://msdn.microsoft.com/en-us/ms348103.aspxhttps://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1249713196&rver=6.0.5276.0&wp=MCLBI&wlcxt=msdn%24msdn%24msdn&wreply=http:%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.windows.forms.cursor.clip.aspx&lc=1033&id=254354https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1249713196&rver=6.0.5276.0&wp=MCLBI&wlcxt=msdn%24msdn%24msdn&wreply=http:%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.windows.forms.cursor.clip.aspx&lc=1033&id=254354http://www.microsoft.com/http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspx#Mtps_DropDownFilterTexthttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspx#Mtps_DropDownFilterTexthttp://social.msdn.microsoft.com/Forums/en-US/category/netdevelopmenthttp://msdn.microsoft.com/en-us/netframework/aa569258.aspxhttp://msdn.microsoft.com/en-us/netframework/bb545029.aspxhttp://msdn.microsoft.com/en-us/netframework/aa569263.aspxhttp://msdn.microsoft.com/en-us/netframework/aa663309.aspxhttp://msdn.microsoft.com/en-us/library/aa139615.aspxhttp://msdn.microsoft.com/en-us/netframework/default.aspxhttp://void%280%29/http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(loband).aspxhttp://msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnewhttp://msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnewhttp://msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnewmailto:?subject=Cursor.Clip%20Property%20%20(System.Windows.Forms)&body=This%20URL%20points%20to%20a%20page%20on%20MSDN%20that%20may%20interest%20you:%20http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspxmailto:?subject=Cursor.Clip%20Property%20%20(System.Windows.Forms)&body=This%20URL%20points%20to%20a%20page%20on%20MSDN%20that%20may%20interest%20you:%20http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(printer).aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip(printer).aspx
  • 8/2/2019 Cursor Clip Property (System Windows Forms)

    2/4

    ursor.Clip Property (System.Windows.Forms)

    le:///C|/Documents%20and%20Settings/Dear-U...Clip%20Property%20(System_Windows_Forms).htm (2 of 4) [2009/08/08 04:32:50 .

    Remarks

    Examples

    Type: System.Drawing.Rectangle

    The Rectangle that represents the clipping rectangle for the Cursor, in screen coordinates.

    A clipped cursor is allowed to move only within its clipping rectangle. Generally, the system allows this only if the

    mouse is currently captured. If the cursor is not currently clipped, the resulting rectangle contains the dimension

    the entire screen.

    The following code example creates a cursor from the Current cursor's Handle, changes its position and clipping

    rectangle. The result is the cursor will move up and to the left 50 pixels from where it is when the code is execute

    Additionally, the cursor's clipping rectangle is changed to the bounds of the form (by default it is the user's whole

    screen). This example requires that you have a Form and a Button to call this code when it is clicked.

    Property Value

    C#

    Visual C++

    JScript

    Copy Co

    Copy Co

    Visual Basic

    C#

    publicstatic Rectangle Clip { get; set; }

    public:static property Rectangle Clip {

    Rectangle get ();

    voidset (Rectangle value);

    }

    publicstaticfunctionget Clip () : Rectangle

    publicstaticfunctionset Clip (value : Rectangle)

    PrivateSub 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)

    EndSub

    privatevoid MoveCursor()

    {

    http://msdn.microsoft.com/en-us/library/system.drawing.rectangle.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.current.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.handle.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.button.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.button.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.handle.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.current.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.aspxhttp://msdn.microsoft.com/en-us/library/system.drawing.rectangle.aspx
  • 8/2/2019 Cursor Clip Property (System Windows Forms)

    3/4

    ursor.Clip Property (System.Windows.Forms)

    le:///C|/Documents%20and%20Settings/Dear-U...Clip%20Property%20(System_Windows_Forms).htm (3 of 4) [2009/08/08 04:32:50 .

    Tags W : Add a

    tag

    .NET Framework Security

    Platforms

    The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the

    supported versions, see .NET Framework System Requirements.

    Version Information

    Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

    See Also

    Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003,

    Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

    .NET Framework

    ReferenceCursor Class

    Cursor Members

    System.Windows.Forms Namespace

    UIPermission

    Copy Co

    for all windows to set this property. Associated enumeration: UIPermissionWindow.AllWindows

    Visual C++

    // 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);

    }

    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);

    }

    http://msdn.microsoft.com/Platform/Controls/CCTagEditor/resources/taghelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCTagEditor/resources/taghelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCTagEditor/#http://msdn.microsoft.com/Platform/Controls/CCTagEditor/#http://msdn.microsoft.com/en-us/library/8z6watww.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor_members.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.aspxhttp://msdn.microsoft.com/en-us/library/system.security.permissions.uipermission.aspxhttp://msdn.microsoft.com/en-us/library/system.security.permissions.uipermission.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor_members.aspxhttp://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.aspxhttp://msdn.microsoft.com/en-us/library/8z6watww.aspxhttp://msdn.microsoft.com/Platform/Controls/CCTagEditor/#http://msdn.microsoft.com/Platform/Controls/CCTagEditor/#http://msdn.microsoft.com/Platform/Controls/CCTagEditor/resources/taghelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCTagEditor/resources/taghelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCTagEditor/resources/taghelp.htm
  • 8/2/2019 Cursor Clip Property (System Windows Forms)

    4/4

    ursor.Clip Property (System.Windows.Forms)

    le:///C|/Documents%20and%20Settings/Dear-U...Clip%20Property%20(System Windows Forms).htm (4 of 4) [2009/08/08 04:32:50 .

    2009 Microsoft Corporation. All rights reserved.Terms of Use | Trademarks | Privacy Statement

    Add new content R Annotations

    Community Content W

    http://msdn.microsoft.com/cc300389.aspxhttp://www.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspxhttp://www.microsoft.com/info/privacy.mspxhttp://webform_dopostbackwithoptions%28new%20webform_postbackoptions%28%22ctl00%24wikicontent%24add%22%2C%20%22%22%2C%20false%2C%20%22%22%2C%20%22http//msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnew%22,%20false,%20true))http://msdn.microsoft.com/en-us/library/community-edits.rss?topic=07yd9yty|en-us|90http://msdn.microsoft.com/en-us/library/community-edits.rss?topic=07yd9yty|en-us|90http://msdn.microsoft.com/Platform/Controls/CCSection/resources/cchelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCSection/resources/cchelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCSection/resources/cchelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCSection/resources/cchelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCSection/resources/cchelp.htmhttp://msdn.microsoft.com/Platform/Controls/CCSection/resources/cchelp.htmhttp://msdn.microsoft.com/en-us/library/community-edits.rss?topic=07yd9yty|en-us|90http://msdn.microsoft.com/en-us/library/community-edits.rss?topic=07yd9yty|en-us|90http://webform_dopostbackwithoptions%28new%20webform_postbackoptions%28%22ctl00%24wikicontent%24add%22%2C%20%22%22%2C%20false%2C%20%22%22%2C%20%22http//msdn.microsoft.com/en-us/library/Community-Signup.aspx?ru=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.windows.forms.cursor.clip(VS.90).aspx%3fwbi%3dnew%22,%20false,%20true))http://www.microsoft.com/http://www.microsoft.com/info/privacy.mspxhttp://www.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspxhttp://msdn.microsoft.com/cc300389.aspx