BCB Mailing List

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BCB] BCB1: Popup Troubles



I'm not sure if this will work, try

TMenuItem *ToolItem = new TMenuItem(ToolMenu);

I would think the menu item's parent should be the menu it belongs to.

There is also this example from the help:

This example assumes that the main form of the application has a main menu
with a Window menu item.  The following code adds a separator, and the name
of all forms to the Window menu.

TMenuItem *NewItem = new TMenuItem; // create the separator
NewItem->Caption = "-";
Window1->Add(NewItem); // add it to the Window menu
// now create and add a menu item for each form
for (int I = 0; i < Screen->FormCount; I++) {
    NewItem = new TMenuItem;
    NewItem->Caption = Screen->Forms[I]->Name;
    Window1->Add(NewItem);
}

I would also try creating a TMenuItem with no parameters for the
constructor.


W Komornicki's Home Page | Main Index | Thread Index