Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Cursor Property

Shape.Cursor Property

Gets or sets the cursor that is displayed when the mouse pointer is resting on a line or shape control.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

[BrowsableAttribute(true)]
public Cursor Cursor { get; set; }

Property Value

Type: System.Windows.Forms.Cursor
A Cursor that represents the cursor to display when the mouse pointer is resting on the control.

Assign a Cursor to the Cursor property of the control to change the cursor that is displayed when the mouse pointer is resting on the control.

The Cursor property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control or form. For example, an OvalShape control will have the same Cursor as its parent Form by default.

The following example displays a hand cursor when the mouse passes over a RectangleShape control. This code requires that you have a Form with a RectangleShape control on it.

private void ShapeCursor_Load(object sender, EventArgs e)
{
    rectangleShape1.Cursor = Cursors.Hand;
}

Show:
© 2015 Microsoft