Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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

TdxAlertWindowManager.OnCustomDrawBackground Event

In This Article

Enables you to custom paint an alert window‘s background.

#Declaration

Delphi
property OnCustomDrawBackground: TdxAlertWindowManagerCustomDrawBackgroundEvent read; write;

#Remarks

Sender specifies the alert window manager that fired the event.

AAlertWindow specifies the alert window being custom painted.

ACanvas specifies the drawing surface.

AViewInfo provides ViewInfo information (a TdxAlertWindowViewInfo class instance) used to paint the alert window’s background. Refer to the TdxAlertWindowHitTest.HitBackground property description to learn about the main TdxAlertWindowViewInfo properties accessible via AViewInfo that you can use for custom painting.

ADone specifies whether default painting is required. Set ADone to True, to prevent default code execution.

The following code snippet demonstrates how to handle the OnCustomDrawBackground event to custom paint an alert window’s background to help end-users discern messages displayed in this window.

Delphi
const
  cxBackColorMap: array[0..3] of TColor = (clLtGray, clMedGray, clDkGray, clMedGray);
procedure <Form>.<dxAlertWindowManager>CustomDrawBackground(Sender: TObject; AAlertWindow: TdxAlertWindow; ACanvas: TcxCanvas; AViewInfo: TdxAlertWindowViewInfo; var ADone: Boolean);
begin
  ACanvas.FillRect(AViewInfo.Bounds, cxBackColorMap[AAlertWindow.CurrentMessageIndex mod 4]);
  ADone := True;
end;
See Also