相关文章  
  • 重要文件的铠甲:EFS加密
  • Windows2000支持的几种文件系统与比较
  • 你真的了解windows的自启动方式吗?
  • C# 中数组和类型转换的功能实现
  • C#中调用带回调函数和自定义结构体的DLL例程
  • 为 Windows XP Embedded 创建自定义组件
  • 企业用户应当如何利用Windows XP SP2
  • 将现存的信息系统移植到组件化架构
  • 应用程序互操作性:互用性基本原理
  • 动态汉化Windows技术的一些简要分析
  •   推荐  
      科普之友首页   专利     科普      动物      植物        天文   考古   前沿科技
     您现在的位置在:  首页 >>文献 >>培训

    演练:在Excel中建立自定义菜单项5

    菜单栏项目标签写着Custom Code的菜单显示在帮助菜单右边。如图一所示:
      
      
      建立菜单项目
      有了合适的自定义菜单栏,你就可以加入新的菜单中了。菜单项目表示为CommandBarControl对象,你将使用先前建立的菜单栏项目Controls集合的Add方法来建立一个新的CommandBarControl实例。
      
      1.增加下列程序到OfficeCodeBehind类中,这段程序建立了CommandBarControl并且设置其标题:
      
      ' Visual Basic
      
      Private Function CreateButton( _
      
      ByVal Parent As Office.CommandBarPopup, _
      
      ByVal Caption As String) As Office.CommandBarButton
      
      Try
      
      Dim cbc As Office.CommandBarControl
      
      cbc = Parent.Controls.Add( _ Office.MsoControlType.msoControlButton, Temporary:=True)
      
      cbc.Caption = Caption
      
      cbc.Visible = True
      
      Return DirectCast(cbc, Office.CommandBarButton)
      
      Catch ex As Exception
      
      MessageBox.Show(ex.Message, _页码:[1] [2] [3] [4] [5] [6] [7] [8] [9]5页、共9页
         

          设为首页       |       加入收藏       |       广告服务       |       友情链接       |       版权申明      

    Copyriht 2007 - 2008 ©  科普之友 All right reserved