Поделиться через


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)

Syntax

'Declaration
<BrowsableAttribute(True)> _
Public Property Cursor As Cursor
    Get
    Set
[BrowsableAttribute(true)]
public Cursor Cursor { get; set; }
[BrowsableAttribute(true)]
public:
property Cursor^ Cursor {
    Cursor^ get ();
    void set (Cursor^ value);
}
[<BrowsableAttribute(true)>]
member Cursor : Cursor with get, set
function get Cursor () : Cursor
function set Cursor (value : Cursor)

Property Value

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

Remarks

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.

Examples

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 Sub ShapeCursor_Load() Handles MyBase.Load
    RectangleShape1.Cursor = Cursors.Hand
End Sub
private void ShapeCursor_Load(object sender, EventArgs e)
{
    rectangleShape1.Cursor = Cursors.Hand;
}

.NET Framework Security

See Also

Reference

Shape Class

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

How to: Draw Lines with the LineShape Control (Visual Studio)

How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)

Introduction to the Line and Shape Controls (Visual Studio)