Back to Devexpress

ChartMouseAction.ModifierKeys Property

corelibraries-devexpress-dot-xtracharts-dot-chartmouseaction-62a8003c.md

latest2.6 KB
Original Source

ChartMouseAction.ModifierKeys Property

Gets or sets the modifier keys.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public ChartModifierKeys ModifierKeys { get; set; }
vb
Public Property ModifierKeys As ChartModifierKeys

Property Value

TypeDescription
ChartModifierKeys

The modifier key.

|

Available values:

NameDescription
None

No key is specified.

| | Control |

The Control key.

| | Shift |

The Shift key.

| | Alt |

The Alt key.

|

Remarks

Use the ModifierKeys and ChartMouseAction.MouseButton properties to specify the action the end user performs to interact with the chart.

Example

This example shows how to specify actions to zoom in and zoom out of the chart:

To configure the action, use the ChartMouseAction.ModifierKeys and ChartMouseAction.MouseButton properties.

csharp
XYDiagram diagram = chartControl.Diagram as XYDiagram;
if(diagram != null) {
    diagram.ZoomingOptions.ZoomInMouseAction.ModifierKeys = ChartModifierKeys.Control;
    diagram.ZoomingOptions.ZoomInMouseAction.MouseButton = MouseButtons.Right;
    diagram.ZoomingOptions.ZoomOutMouseAction.ModifierKeys = ChartModifierKeys.Shift;
    diagram.ZoomingOptions.ZoomOutMouseAction.MouseButton = MouseButtons.Right;
}
vb
Dim diagram As XYDiagram = CType(chartControl.Diagram,XYDiagram)
If (Not (diagram) Is Nothing) Then
    diagram.ZoomingOptions.ZoomInMouseAction.ModifierKeys = ChartModifierKeys.Control
    diagram.ZoomingOptions.ZoomInMouseAction.MouseButton = MouseButtons.Right
    diagram.ZoomingOptions.ZoomOutMouseAction.ModifierKeys = ChartModifierKeys.Shift
    diagram.ZoomingOptions.ZoomOutMouseAction.MouseButton = MouseButtons.Right
End If

See Also

ChartMouseAction Class

ChartMouseAction Members

DevExpress.XtraCharts Namespace