How can I delete menu items at run-time?
Applies To: C++Builder 1 or higher
Category: Knowledge Base
- Start a new project using File | New Application.
-
- Add a Menu. Insert two menu items: First and Second.
-
- Edit the OnShow event of your form:
-
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- MainMenu1->Items->Delete(0);
- }
-
- When the program is executed, First should not be visible. You can also delete subitems using MainMenu1->Items->Items[0]->Delete(0);
C++Builder Developer's Network
Copyright © Yoto Yotov