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
Create a planner item with direct editing

For creating a planner item by just starting to type the text that should go in the planner item, the OnPlannerKeyPress can be used. To make sure that the key that is pressed to create the planner item is the first character of the planner item text, following code can be used :
procedure TForm1.Planner1PlannerKeyPress(Sender: TObject; var key:char; position, fromSel, fromSelPrecis, toSel, toSelPrecis: Integer);
begin
  with planner1.Items.Add do
  begin
    itempos := position;
    itembegin := fromSel;
    itemend := toSel;
    captiontype := ctTime;
    Text.Add(key);
    Edit;
    planner1.MemoEdit.SelStart := 1;
    planner1.MemoEdit.SelLength := 0;
  end;
end;