Default
Google

How can I delete menu items at run-time?

Applies To: C++Builder 1 or higher
Category: Knowledge Base

 1.
  Start a new project using File | New Application.
 
 2.
  Add a Menu. Insert two menu items: First and Second.
 
 3.
  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



Acquiring image from ProHosting Banner Exchange