明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1961|回复: 5

VBA工具栏图标格式怎么改变?

[复制链接]
发表于 2005-3-26 12:06:00 | 显示全部楼层 |阅读模式
请问一下各位大侠,VBA工具栏图标格式怎么改变?
发表于 2005-3-26 21:57:00 | 显示全部楼层
图标还要改什么格式,想变成怎样?
发表于 2005-3-27 21:52:00 | 显示全部楼层
工具栏的图标知道怎样改变,但图标格式不知道怎样改变!
发表于 2005-3-28 08:58:00 | 显示全部楼层
请问如何在菜单工具条上显示自己定义的图标啊?
发表于 2005-3-30 15:15:00 | 显示全部楼层
Dim newToolBarSeparator As AcadToolbarItem
Dim SmallBitmapName(42) As String
Dim LargeBitmapName(42) As String
Set MenuGroupObject = ThisDrawing.Application.MenuGroups.Item(0)
Set ToolbarObject = MenuGroupObject.Toolbars.Add("测量菜单")
Dim Popen As String
Popen = Chr(3) + Chr(3) + Chr(95) + "open" + Chr(13)
Set ButtonObject(1) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "打开文件", "打开文件", Popen)
Dim Psave As String
Psave = Chr(3) + Chr(3) + Chr(95) + "qsave" + Chr(13)
Set ButtonObject(2) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "保存文件", "保存文件", Psave)
Dim Pprinter As String
Pprinter = Chr(3) + Chr(3) + Chr(95) + "plot" + Chr(13)
Set ButtonObject(3) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "打印文件", "打印文件", Pprinter)
Dim Pcut As String
Pcut = Chr(3) + Chr(3) + Chr(95) + "cutclip" + Chr(13)
Set ButtonObject(4) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "剪切", "剪切", Pcut)
Set newToolBarSeparator = ToolbarObject.AddSeparator(ToolbarObject.Count + 1)
Dim pCopy As String
pCopy = Chr(3) + Chr(3) + Chr(95) + "copyBase" + Chr(13)
Set ButtonObject(5) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "带基点复制", "带基点复制", pCopy)
Dim Ppaste As String
Ppaste = Chr(3) + Chr(3) + Chr(95) + "pasteclip" + Chr(13)
Set ButtonObject(6) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "粘贴", "粘贴", Ppaste)
Dim Pbreak As String
Pbreak = Chr(3) + Chr(3) + Chr(95) + "break" + Chr(13)
Set ButtonObject(7) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "打断", "打断", Pbreak)
Set newToolBarSeparator = ToolbarObject.AddSeparator(ToolbarObject.Count + 1)
Dim Ptrim As String
Ptrim = Chr(3) + Chr(3) + Chr(95) + "trim" + Chr(13)
Set ButtonObject(8) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "截断", "截断", Ptrim)
Dim Pextend As String
Pextend = Chr(3) + Chr(3) + Chr(95) + "extend" + Chr(13)
Set ButtonObject(9) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "延伸", "延伸", Pextend)
Dim Pmove As String
Pmove = Chr(3) + Chr(3) + Chr(95) + "move" + Chr(13)
Set ButtonObject(10) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "移动", "移动", Pmove)
SmallBitmapName(1) = "C:\Program Files\AutoCAD 2004\New Folder\POpen.BMP"
SmallBitmapName(2) = "C:\Program Files\AutoCAD 2004\New Folder\Psave.BMP"
SmallBitmapName(3) = "C:\Program Files\AutoCAD 2004\New Folder\Pprinter.BMP"
SmallBitmapName(4) = "C:\Program Files\AutoCAD 2004\New Folder\Pcut.BMP"
SmallBitmapName(5) = "C:\Program Files\AutoCAD 2004\New Folder\Pcopy.BMP"
SmallBitmapName(6) = "C:\Program Files\AutoCAD 2004\New Folder\Ppaste.BMP"
SmallBitmapName(7) = "C:\Program Files\AutoCAD 2004\New Folder\Pdd.BMP"
SmallBitmapName(8) = "C:\Program Files\AutoCAD 2004\New Folder\Pcj.BMP"
SmallBitmapName(9) = "C:\Program Files\AutoCAD 2004\New Folder\Pys.BMP"
SmallBitmapName(10) = "C:\Program Files\AutoCAD 2004\New Folder\Pmove.BMP"
发表于 2005-3-31 08:26:00 | 显示全部楼层
请问楼上的大侠:ButtonObject和SmallBitmapName是什么类型的变量(你怎么定义的)? 其中ButtonObject(10) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "移动", "移动", Pmove) 最后一个变量Pmove可以是自定义的函数对像吧?? 请指教!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 18:51 , Processed in 0.201348 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表