Condividi tramite


Metodo ShapeElement.GetCursor

Ottiene il puntatore che appare al passaggio del mouse sulla forma.

Spazio dei nomi:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

Sintassi

'Dichiarazione
Public Overridable Function GetCursor ( _
    currentCursor As Cursor, _
    diagramClientView As DiagramClientView, _
    mousePosition As PointD _
) As Cursor
public virtual Cursor GetCursor(
    Cursor currentCursor,
    DiagramClientView diagramClientView,
    PointD mousePosition
)

Parametri

Valore restituito

Tipo: System.Windows.Forms.Cursor
Puntatore visualizzato al passaggio del mouse sulla forma.

Esempi

public override global::System.Windows.Forms.Cursor GetCursor(global::System.Windows.Forms.Cursor currentCursor, DslDiagrams::DiagramClientView diagramClientView, DslDiagrams::PointD mousePosition)
{
if (this.MouseDownHitShape == null && currentCursor != global::System.Windows.Forms.Cursors.No)
{
DslDiagrams::DiagramHitTestInfo hitTestInfo = new DslDiagrams::DiagramHitTestInfo(diagramClientView);
this.Diagram.DoHitTest(mousePosition, hitTestInfo);
DslDiagrams::ShapeElement shape = hitTestInfo.HitDiagramItem.Shape;

DslDiagrams::ConnectionType connectionType = GetConnectionTypes(shape, null)[0];
string warningString = string.Empty;
if (!connectionType.CanCreateConnection(shape, null, ref warningString))
{
return global::System.Windows.Forms.Cursors.No;
}
}
return base.GetCursor(currentCursor, diagramClientView, mousePosition);
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

ShapeElement Classe

Spazio dei nomi Microsoft.VisualStudio.Modeling.Diagrams