Board index » delphi » Who fired a TMenuItem.OnClick event?

Who fired a TMenuItem.OnClick event?

Hi there!

I have an App with some TPopupMenus, I have set its captions at runtime to
the most recent dates that I have selected before from some
For example: I have a TPopupMenuStartDate, it has 5 recent dates as its
captions (TMenuItems), also, I have assigned this popupmenu to some
TDateTimePickers that I have in my app....

I would like to set the date of a TdateTimePicker to the date selected from
its popupmenu...

I have assigned all TMenuItem.OnClick events to one event where I get the
TMenuItem caption and convert it to a valid date value, but i dont know how
to assing such date to the TDateTimePicker.
Some code I have:

procedure TForm4.popupStartDateClick(Sender: TObject);
var d:String;
    d := (Sender as TMenuItem).Caption;
    Delete(d,Pos(':',d),Length(d)-8);  // some caltulations to get the date
    TDatetimePicker.Date := StrToDate(d); <-- What should I use instead of
TDateTimePicker.Date ???

Any help would be appreciated! =)


Re:Who fired a TMenuItem.OnClick event?

"Manuel Jacquez" <> wrote:

duplicate message - see my response to your first

Other Threads