OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Adding Menu Resources To Frame Windows

Instead of assigning a menu resource directly to the Attr.Menu member of a frame window (for example, Attr.Menu = MENU_1;), you must use the TFrameWindow::AssignMenu() function, as in the following example:

AssignMenu(MENU_1);

AssignMenu is defined in the TFrameWindow class and is available in any class derived from TFrameWindow, such as TMDIFrame, TMDIChild, TDecoratedFrame, and TFloatingFrame. It takes a TResId for its only parameter and returns true if the assignment operation was successful. AssignMenu is declared virtual, so you can override it in your own TFrameWindow-derived classes.

You can change the menu after the frame window has been created. To change the frame window's menu, call the window object's TFrameWindow::SetMenu() function.

SetMenu(MENU_2);

See Also