Fog Creek Software
Discussion Board

Popup Menus

I want to use to the same popupmenu to populate several different TEdit.text properties depending on what I select from the Popup Menu.

I tries something like with (sender as Tedit).text := 'Hello World'.  I think I'm close, but I don't quite have it.

Thanks for your help.

Dave Davis
Wednesday, January 8, 2003

The component that calls the popup menu is in the PopupComponent property. So your code needs to be something like this:

if PopupMenu1.PopupComponent is TEdit then
  (PopupMenu1.PopupComponent as TEdit).Text := 'Whatever';

Jan Derk
Thursday, January 9, 2003

*  Recent Topics

*  Fog Creek Home