//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "SubItemsEnabled.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: SubItemsEnabled
// Property: Menus.TMenuItem.Count
// Property: Menus.TMenuItem.Items
// Property: Menus.TMenuItem.Enabled

// BeginCode
/*
The following code disables all the subitems of of the menu
item File1.  This example requires a button, a TMainMenu
with several menu items added, one of them named File1.
*/
void __fastcall TForm1::DisableSubItemsClick(TObject *Sender)
{
  for (int i = 0; i < File1->Count; i++)
  {
	File1->Items[i]->Enabled = false;
  }
}

void __fastcall TForm1::Edit1Click(TObject *Sender)
{
  ListBox1->Items->Add("This is the Edit command");
}

void __fastcall TForm1::File1Click(TObject *Sender)
{
  ListBox1->Items->Add("This is the File command");
}

void __fastcall TForm1::FileSub11Click(TObject *Sender)
{
  ListBox1->Items->Add("This is the FileSub1 command");
}

void __fastcall TForm1::FileSub21Click(TObject *Sender)
{
  ListBox1->Items->Add("This is the FileSub2 command");
}

void __fastcall TForm1::FileSub31Click(TObject *Sender)
{
  ListBox1->Items->Add("This is the FileSub3 command");
}

void __fastcall TForm1::Options1Click(TObject *Sender)
{
  ListBox1->Items->Add("This is the Options command");
}
// EndCode
// EndExample: SubItemsEnabled
//---------------------------------------------------------------------------
