江苏侏儒男娶165妻子:数组方法动态创建菜单的方法

来源:百度文库 编辑:中财网 时间:2024/04/30 02:27:08
建立file主菜单mnu_file  
  建立item子菜单mnu_item,索引0  
   
   
  Option   Explicit  
  Private   Sub   Command1_Click()  
          Load   mnu_item(1)  
          mnu_item(1).Caption   =   "this   is   sub1"  
          Load   mnu_item(2)  
          mnu_item(2).Caption   =   "this   is   sub2"  
          Load   mnu_item(3)  
          mnu_item(3).Caption   =   "this   is   sub3"  
          Load   mnu_item(4)  
          mnu_item(4).Caption   =   "this   is   sub4"  
          Load   mnu_item(5)  
          mnu_item(5).Caption   =   "this   is   sub5"  
  End   Sub  
  Private   Sub   mnu_item_Click(Index   As   Integer)  
          Select   Case   Index  
                  Case   1  
                          Debug.Print   "1"  
                  Case   2  
                          Debug.Print   "2"  
                  Case   3  
                          Debug.Print   "3"  
                  Case   4  
                          Debug.Print   "4"  
                  Case   5  
                          Debug.Print   "5"  
          End   Select  
  End   Sub