Share via


ShapeElement.KeyPress Event

Occurs when the user presses and releases a key.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)

Syntax

'Declaration
Public Event KeyPress As DiagramKeyPressEventHandler
'Usage
Dim instance As ShapeElement 
Dim handler As DiagramKeyPressEventHandler 

AddHandler instance.KeyPress, handler
public event DiagramKeyPressEventHandler KeyPress
public:
 event DiagramKeyPressEventHandler^ KeyPress {
    void add (DiagramKeyPressEventHandler^ value);
    void remove (DiagramKeyPressEventHandler^ value);
}
JScript does not support events.

Remarks

A convenient place to add a listener for this event is InitializeInstanceResources(). To override this method in your custom code, you must set the Generates Double Derived property for the shape in DSL Definition and then click Transform All Templates in Solution Explorer.

.NET Framework Security

See Also

Reference

ShapeElement Class

ShapeElement Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace