How to change a resource's style and colour.


Note: resources aren't actually displayed with any style or in any colour, but the resource's Style and Color properties are the default style and colour for allocations for that resource.

var
  r: TssResource;
begin
  r := RAC.FindResource('My Resource');
  if Assigned(r) then begin
    r.BeginUpdate;
    try
      r.Color := clBlue;
      r.Style := rsLine;
    finally
      r.EndUpdate;
    end;
  end;
end;

Any allocations for this resource whose colour and style matched the resource's old colour and style values, are also set to use the new colour and style.

What People Say

Thanks for the component. It's quite amazing, powerful and unique.
Raymond Kennington, Programming Solutions (see the full quote)
More …

No malware No spam
McAfee Site Report
Web of Trust