[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

TMenuItem.Create ... Not creating?

var
  menuItemA:TMenuItem;
begin
menuItemA := TMenuItem.Create(form1.popupMenuA);
menuItemA.caption:='TEST';


Why doesn't this work?  I am using Delphi 5 and I am trying to create entries on a popup menu at runtime.  It seems to work, but the entree never shows up on the pop up menu.. I can't figure out where it is going..  Im sure its something simple Im not doing.. I tried to assign the parent,  menuItemA.parent := popupMenuA;  but that didnt work.. its now read only in D5 evidently..

Any help..thanks..

-Pal

0
Palamedes
Asked:
Palamedes
1 Solution
 
brainwareCommented:
var
  menuItemA:TMenuItem;
begin
 menuItemA := TMenuItem.Create(form1.popupMenu);
 form1.popupMenu.Items.Add(MenuItemA);
 menuItemA.caption:='TEST';

i did remove the A of form1.popupMenuA,
whatever Above works in Delphi 3.
0
 
PalamedesAuthor Commented:
Thanks a bunch..
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now