HotTrackEventArgs.Cancel Property
Gets or sets whether the hot-tracking should be cancelled.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.2.dll
NuGet Package: DevExpress.Charts
#Declaration
#Property Value
Type | Description |
---|---|
Boolean | true to cancel the hot-tracking of an object; otherwise, false. |
#Example
This example demonstrates how to implement custom hot-tracking and selection of the chart’s elements at runtime.
Note
To enable runtime hot-tracking and selection, the ChartSingle
, Multiple
or Extended
.
If you want to change the default hot-tracking and selection, you should handle the ChartControl.ObjectHotTracked and ChartControl.ObjectSelected events, implement your custom hot-tracking and selection approaches and set the Cancel property to true.
For example, the code below illustrates how to disable selection and hot-tracking of a chart’s diagram.
using DevExpress.XtraCharts;
// ...
private void chartControl1_ObjectHotTracked(object sender, HotTrackEventArgs e) {
// Prevent the chart's diagram from being hot-tracked.
if (e.Object is Diagram)
e.Cancel = true;
}
private void chartControl1_ObjectSelected(object sender, HotTrackEventArgs e) {
// Prevent the chart's Diagram from being selected.
if (e.Object is Diagram)
e.Cancel = true;
}
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Cancel property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.