Question

I have 2 memo's on a form and 1 Tpopupmenu I have assigned the popup menu as the popup menu for both memos. The pop up menu has a couple of menuitem assigned to it, when I right mouse click on either of the memo's and click on one of the menu items on its onclick event I would like to be able to know which memo is the one where the menu was invoked from but cannot figure out how to find out which memo it was!!

Could anyone give me a pointer on how to detect the underlying memo.

thanks

colin

Was it helpful?

Solution

You can use the PopupComponent property of the popup menu:

procedure TForm1.PopupItemClick(Sender: TObject);
begin
  if PopupMenu1.PopupComponent = Memo1 then
    ..
  else
    ..
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top