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

TcxSchedulerCustomDrawEventEvent Type

The custom draw event handler for user events.

#Declaration

Delphi
TcxSchedulerCustomDrawEventEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean) of object;

#Parameters

Name Type Description
Sender TObject

The View that raised the event.

ACanvas TcxCanvas

The target user event’s canvas.

AViewInfo TcxSchedulerEventCellViewInfo

The target user event’s ViewInfo information.

ADone Boolean

Assign True to this parameter if you override the built-in event draw routine. Do not change the parameter value if you need only to complement the built-in draw routine with custom draw operations.

#Remarks

Cast the Sender parameter value to the actual class to access all class-specific members.

#Code Example

The following OnCustomDrawEvent event handler draws unchanged recurring user events in red:

procedure TForm1.cxScheduler1CustomDrawEvent(Sender: TObject;
  ACanvas: TcxCanvas; AViewInfo: TcxSchedulerEventCellViewInfo;
  var ADone: Boolean);
begin
  if AViewInfo.Event.EventType = etOccurrence then
    begin
      AViewInfo.Transparent := True;
      ACanvas.FillRect(AViewInfo.Bounds, clRed);
    end;
end; 

Note

You can custom draw individual parts of user events. Refer to the following topic for detailed information: Custom Drawing.

The scheduler control’s OnCustomDrawEvent event references the TcxSchedulerCustomDrawEventEvent type.

See Also