Compartir a través de


ShapeContainer.Cursor (Propiedad)

Obtiene o establece el cursor que se muestra cuando el puntero del mouse se sitúa sobre un ShapeContainer.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

'Declaración
Public Overrides Property Cursor As Cursor
public override Cursor Cursor { get; set; }
public:
virtual property Cursor^ Cursor {
    Cursor^ get () override;
    void set (Cursor^ value) override;
}
abstract Cursor : Cursor with get, set 
override Cursor : Cursor with get, set
override function get Cursor () : Cursor 
override function set Cursor (value : Cursor)

Valor de propiedad

Tipo: Cursor
Un Cursor que representa el cursor que se va a mostrar cuando el puntero del mouse se sitúa sobre el ShapeContainer.

Comentarios

Asignar Cursor a la propiedad de Cursor de ShapeContainer para cambiar el cursor que se muestra cuando el puntero del mouse está sobre ShapeContainer.

La propiedad Cursor es una propiedad de ambiente. Una propiedad de ambiente es una propiedad que, si no se establece, se recupera del control principal o formulario. Por ejemplo, de forma predeterminada, el control ShapeContainer tendrá la misma propiedad Cursor que su control Form principal.

Ejemplos

El ejemplo siguiente muestra una mano cursor del mouse pasa sobre ShapeContainer pero no cuando pasa sobre RectangleShape incluido en ShapeContainer. Este código requiere que tenga Form con un control de RectangleShape en él.

Private Sub Form1_Load() Handles MyBase.Load
    ' Display the hand cursor when mouse is over the ShapeContainer.
    ShapeContainer1.Cursor = Cursors.Hand
    ' Display the default cursor when mouse is over the RectangleShape.
    RectangleShape1.Cursor = Cursors.Default 
End Sub
private void form1_Load(System.Object sender, System.EventArgs e)
{
    // Display the hand cursor when mouse is over the ShapeContainer.
    shapeContainer1.Cursor = Cursors.Hand;
    // Display the default cursor when mouse is over the RectangleShape.
    rectangleShape1.Cursor = Cursors.Default;
}

Seguridad de .NET Framework

Vea también

Referencia

ShapeContainer Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Introducción a los controles de líneas y formas (Visual Studio)

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)