unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Menus;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    MainMenu2: TMainMenu;
    aaaa1: TMenuItem;
    bbbb1: TMenuItem;
    cccc1: TMenuItem;
    ddddd1: TMenuItem;
    zzzzz1: TMenuItem;
    xxxxx1: TMenuItem;
    yyyyyy1: TMenuItem;
    wwwww1: TMenuItem;
    kkkkkk1: TMenuItem;
    pppppp1: TMenuItem;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    eeeeee: TMenuItem;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure bbbb1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Menu:=MainMenu1;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Menu:=MainMenu2;
end;

procedure TForm1.bbbb1Click(Sender: TObject);
begin
//  if Sender is TMenuItem then
     Label1.Caption:=(Sender as TMenuItem).Caption;
  //lub inaczej Label1.Caption:=TMenuItem(Sender).Caption;
end;
(*
  var

  I: Integer;
begin
  for I := 0 to MenuItem1.Count-1 do
    MenuItem1.Items[I].Enabled := False;

end;
*)
end.
