Re: Popup Menu's Parent/Owner Component



<simonkolomyjec@xxxxxxxxx> wrote in message
news:1193201561.741450.52840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I have a app that dynamically creates a page in a pagecontrol with a
memo and assigns a popupmenu to each memo. This popup menu has a
print, export and close page item.

I can close the page fine by closing the active page in the page
control, however i cannot print or save the memo contents because i
can not get access to the popup menu's owner (i.e. the memo) when the
popup menu is clicked.

I have tried:
(Sender as TMemo)
(Sender as TpopupMenu).Owner as TMemo)
(Sender as Tpopupmenu).Parent as TMemo)

You're obviously fishing as to what Sender is anyway. Set a breakpoint
and put a watch on Sender.ClassName.

Then, when you're back from debugging, type 'PopupComponent', press F1,
read help. (You could have found this by reading the property list for
TPopupMenu - just as I did, a minute ago.)

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Popup Menus Parent/Owner Component
    ... memo and assigns a popupmenu to each memo. ... can not get access to the popup menu's owner when the ... (Sender as TpopupMenu).Owner as TMemo) ...
    (comp.lang.pascal.delphi.misc)
  • Re: mail header Content-Disposition
    ... > action on the part of the recipient, while inline message components ... > is needed to allow the sender to transmit this sort of presentational ... > approaches is beyond the scope of this memo; ... > indicate a default archival disposition; a filename. ...
    (comp.security.misc)
  • Re: Re: Re: save memo and print with exact wordwrapping
    ... These soft brakes in a tmemo are completely elusive somehow. ... character that can be in a memo that doesn't show up but still can be there. ... So memo line spacing is unprintable. ...
    (alt.comp.lang.borland-delphi)
  • printing memo content with drawtext preserving exact dimensions/wrapping
    ... This succeeds with every component except with a tmemo. ... At design time left aligning a label with a memo makes the memotext indent some pixels compared to ...
    (alt.comp.lang.borland-delphi)
  • Re: select a string in memo field an get them a other color then the rest of the text
    ... >i have a small problem with my TMemo Text Field. ... >my memo and i will select some words and give them a other color then ... >But how can i change the color of the selected words? ... Use a RichTextbox ...
    (comp.lang.pascal.delphi.misc)