But now there is another problem: I want to add an Icon to an planner Item, and i have tried the example in the TMS tutorial:
procedure TForm1.TMSFNCPlanner1AfterDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRectF; AItem: TTMSFNCPlannerItem); var bmp: TBitmap; rbmp: TRectF; begin if AItem.ConflictsForPosition(0) > 1 then begin bmp := TMSFNCBitmapContainer1.FindBitmap('warning'); if Assigned(bmp) then begin rbmp := RectF(ARect.Right - 26, ARect.Bottom - 26, ARect.Right - 2, ARect.Bottom - 2); ACanvas.DrawBitmap(bmp, RectF(0, 0, bmp.Width, bmp.Height), rbmp, 1); end; end; end;
In my OnAfterDrawItem event there is no aCanvas so i used this code:
procedure TfrmPlannerMainForm.AgendaAfterDrawItem(Sender: TObject; AGraphics: TTMSFNCGraphics; ARect: TRectF; AItem: TTMSFNCPlannerItem); var bmp: TTMSFNCBitmap; rbmp: TRectF; begin
bmp := TMSFNCBitmapContainer1.FindBitmap('warning'); if Assigned(bmp) then begin rbmp := RectF(ARect.Right-26,ARect.Bottom-26,ARect.Right-2,ARect.Bottom-2); AGraphics.DrawBitmap(0,0,RectF(0,0,10,10),0,rbmp); end; end; But this does not work. Who knows what to do.