VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.Menu mnugrow 
      Caption         =   "Безразмерное меню"
      Begin VB.Menu mnuadd 
         Caption         =   "Добавит"
      End
      Begin VB.Menu mnuRemove 
         Caption         =   "Удалить"
      End
      Begin VB.Menu mnuExit 
         Caption         =   "Выход"
      End
      Begin VB.Menu mnuItems 
         Caption         =   "-"
         Index           =   0
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim glastelement As Integer

Private Sub Form_Load()
glastelement = 0
mnuRemove.Enabled = False
End Sub

Private Sub mnuadd_Click()
glastelement = glastelement + 1
Load mnuItems(glastelement)
mnuItems(glastelement).Caption = "Пункт " + Str(glastelement)
mnuRemove.Enabled = True
End Sub

Private Sub mnuExit_Click()
End
End Sub

Private Sub mnuItems_Click(Index As Integer)
MsgBox "Вы выбрали пукт " + Str(Index)
End Sub

Private Sub mnuRemove_Click()
Unload mnuItems(glastelement)
glastelement = glastelement - 1
If glastelement = 0 Then
mnuRemove.Enabled = False
End If
End Sub
