How to show a custom hint for allocations.


Implement a handler for the OnAllocationAutoHint event, and set the Hint argument to be the desired hint text.

Note: In order to see hints, the ShowHint property must be true, and the racAutoHint must be enabled in the options to allow the automatic generation of hints.

procedure TForm1.RACAllocationAutoHint(Sender: TObject;
                                       Resource: TssResource;
                                       Allocation: TssResourceAllocation;
                                       StartDateTime,  EndDateTime: TDateTime;
                                       ToResource: TssResource;
                                       var Hint: string);
const
  DateFormatStr: string = 'dd.mm.yyyy';
begin
  Hint := FormatDateTime(DateFormatStr, StartDateTime) +
          ' - ' +
          FormatDateTime(DateFormatStr, EndDateTime) +
          ' (' + IntToStr(round(EndDateTime - StartDateTime)) + ')';
end;
What People Say

I did want to drop you a note and tell you what a wonderful component. It's a must have component if you are a serious Delphi developer.
Miguel Henley, Brazil
More …

No malware No spam
McAfee Site Report
Web of Trust