乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 26|回复: 1

请教一个关于工具条的问题

[复制链接]

7

主题

9

帖子

2

银币

初来乍到

Rank: 1

铜币
37
发表于 2006-9-16 01:59:00 | 显示全部楼层 |阅读模式
Sub Example_AddToolbarButton()
    ' This example creates a new toolbar called TestToolbar and inserts a
    ' toolbar button into it. The toolbar is then displayed.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.
   
    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)
   
    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")
   
    ' Add a button to the new toolbar
    Dim newButton As AcadToolbarItem
    Dim openMacro As String
   
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)
   
    Set newButton = newToolBar.AddToolbarButton("", "NewButton", "Open a file.", openMacro)
   
   
    ' Display the toolbar
    newToolBar.Visible = True
   
End Sub 1:上面的代码 可以生成一个条,但是关掉生成的toolbar后 ,再运行程序就会出错,    可能是关掉的toolbar没有卸载完。怎么彻底删除toolbar?2: 生成的toolbar,上面的按钮只能实现打开、保存等功能,怎么能点击按钮后调用自己    的函数来实现其他功能?急切等待您的指点
回复

使用道具 举报

3

主题

10

帖子

2

银币

初来乍到

Rank: 1

铜币
22
发表于 2006-9-18 19:56:00 | 显示全部楼层
那是因为已经有了toolbar了
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-6 13:16 , Processed in 1.156286 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表