corelibraries-devexpress-dot-xtracharts-dot-chartmouseaction.md
Gets or sets the mouse button the end user should use to interact with the chart.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public PortableMouseButtons MouseButton { get; set; }
Public Property MouseButton As PortableMouseButtons
| Type | Description |
|---|---|
| DevExpress.Portable.Input.PortableMouseButtons |
The mouse button that should be used to interact with the chart.
|
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.
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;
}
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