Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    HeatmapControl.CustomPaint Event

    Occurs after all the heatmap’s visual elements have been drawn.

    Namespace: DevExpress.XtraCharts.Heatmap

    Assembly: DevExpress.XtraCharts.v25.1.UI.dll

    NuGet Package: DevExpress.Win.Charts

    #Declaration

    public event HeatmapCustomPaintEventHandler CustomPaint

    #Event Data

    The CustomPaint event's data class is HeatmapCustomPaintEventArgs. The following properties provide information specific to this event:

    Property Description
    Bounds Gets the bounds of a custom graphic object.
    DXGraphics Gets the custom graphic object.

    #Remarks

    Use the CustomPaint event to draw custom graphics over your heatmap.

    The following example shows how to handle the CustomPaint event to draw a custom frame on a heatmap surface:

    using DevExpress.Drawing;
    using DevExpress.XtraCharts.Heatmap;
    using System.Drawing;
    
    namespace TestHeatmap {
        public partial class Form1 : Form {
            public Form1() {
                InitializeComponent();
                // ...
                heatmapControl1.CustomPaint += heatmapControl1_CustomPaint_1;
            }
            void heatmapControl1_CustomPaint_1(object sender, HeatmapCustomPaintEventArgs e) {
                using(DXPen pen = new DXPen(Color.Red, 2)) {
                    e.DXGraphics.DrawRectangle(pen, this.heatmapControl1.Diagram.GetBounds());    
                }
            }
        }
    }
    
    See Also