Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TPlanner
Preventing that items are moved to specific time slots

If you want to prevent that at runtime a PlannerItem is moved to a specific timeslot, this can be done from the OnItemMove event. In this event, simply restore the original PlannerItem coordinates and call Abort. Sample code:
procedure TForm1.Planner1ItemMove(Sender: TObject; Item: TPlannerItem;
  FromBegin, FromEnd, FromPos, ToBegin, ToEnd, ToPos: Integer);
begin
  if topos = 2 then
  begin
    ShowMessage('Move to this position not allowed');
    item.ItemBegin := frombegin;
    item.ItemEnd := fromEnd;
    item.ItemPos := frompos;
    abort;
  end;
end;