Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting menu items

Status
Not open for further replies.

nicasa

Programmer
Feb 3, 2003
54
ES
Hi All,

I have a TMainMenu object and various TmenuItem objects.
I would like to know how to delete or remove programmatically a TMenuItem called START (first item in menu).

I have tried this:

TMenuItem->Items->Delete(0);
TMenuItem->Items->Remove(0);

where 0 represents the first menu item.

Neither of these commands work.

I simply cannot see how to use the Items property to access the required TMenuItem.

All help appreciated,


Steven Matthews



 
you could simply disable it or mark the object visible property as false.

tomcruz.net
 
Yo can do what Butthead says, or you
can do this

add a PopupMenu to your form, 2 Buttons and 1 Edit
declare 2 globals identifiers
int Pos=0;
TMenuItme *MenuItem;
in event on click for the 1st button add this code
{
MenuItem = new TMenuItem (this);
MenuItem->Item->Caption = IntToStr(Pos);
PopupMenu1->Items->Add (MenuItem);
Pos++;
}
and in the 2nd button (same event) add this
{
PopupMenu1->Items->Delete (Edit1->Text.ToInt());
}


---LastCyborg---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top