Get Date From Right-Click on PlannerMonthView

Sorry. The question posted when I hit enter after entering the subject. I could not find a way to edit the post so I am including the question in a reply.


I am trying to get the date from the PlannerMonthView when using a Right-Click.

I can get the date when the user selects the date using a Left-Click from the DBPlannerMonthView1DaySelect event. However, if just the Right-Click is issued without selecting the day, I can't find an event that will give me the date of the day I clicked on.

There may or may not be a Planner Item for the date.
If an item exists, I can use the DBPlannerMonthView1ItemRightClick Event.
However, if no item exists, that event does not fire.

Is there a way to determine the date from the Mouse Coordinates, perhaps.

You can do this with:


procedure TForm3.PlannerMonthView1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  dt: TDateTime;
begin
  if Button = mbRight then
  begin
    PlannerMonthView1.DateAtXY(x,y,dt);
    caption := DateToStr(dt);
  end;
end;

That's exactly what I was looking for.

Thanks so much, Bruno.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.