用VBA做的工具条,如何通过菜单实现工具条的显示与隐藏,另在菜单条的旁边作个显示或
用VBA做的工具条,如何通过菜单实现工具条的显示与隐藏,另在菜单条的旁边作个显示或隐藏的标记???用VBA做的工具条,<FONT color=#0938f7>如何通过菜单实现工具条的显示与隐藏</FONT>,另在菜单条的旁边作个显示或隐藏的标记???我用autocad2002
谢谢
lgc 请问搂主大哥,你做的工具条上的工具栏图标放在什么位置,怎么引用自己的图标啊?? 这个问题我也困惑很久了, 帮 顶!!! Dim newToolBarSeparator As AcadToolbarItem<BR> Dim SmallBitmapName(42) As String<BR> Dim LargeBitmapName(42) As String<BR> Set MenuGroupObject = ThisDrawing.Application.MenuGroups.Item(0)<BR> Set ToolbarObject = MenuGroupObject.Toolbars.Add("测量菜单")<BR> Dim Popen As String<BR> Popen = Chr(3) + Chr(3) + Chr(95) + "open" + Chr(13)<BR> Set ButtonObject(1) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "打开文件", "打开文件", Popen)<BR> Dim Psave As String<BR> Psave = Chr(3) + Chr(3) + Chr(95) + "qsave" + Chr(13)<BR> Set ButtonObject(2) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "保存文件", "保存文件", Psave)<BR> Dim Pprinter As String<BR> Pprinter = Chr(3) + Chr(3) + Chr(95) + "plot" + Chr(13)<BR> Set ButtonObject(3) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "打印文件", "打印文件", Pprinter)<BR> Dim Pcut As String<BR> Pcut = Chr(3) + Chr(3) + Chr(95) + "cutclip" + Chr(13)<BR> Set ButtonObject(4) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "剪切", "剪切", Pcut)<BR> Set newToolBarSeparator = ToolbarObject.AddSeparator(ToolbarObject.Count + 1)<BR> Dim pCopy As String<BR> pCopy = Chr(3) + Chr(3) + Chr(95) + "copyBase" + Chr(13)<BR> Set ButtonObject(5) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "带基点复制", "带基点复制", pCopy)<BR> Dim Ppaste As String<BR> Ppaste = Chr(3) + Chr(3) + Chr(95) + "pasteclip" + Chr(13)<BR> Set ButtonObject(6) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "粘贴", "粘贴", Ppaste)<BR> Dim Pbreak As String<BR> Pbreak = Chr(3) + Chr(3) + Chr(95) + "break" + Chr(13)<BR> Set ButtonObject(7) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "打断", "打断", Pbreak)<BR> Set newToolBarSeparator = ToolbarObject.AddSeparator(ToolbarObject.Count + 1)<BR> Dim Ptrim As String<BR> Ptrim = Chr(3) + Chr(3) + Chr(95) + "trim" + Chr(13)<BR> Set ButtonObject(8) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "截断", "截断", Ptrim)<BR> Dim Pextend As String<BR> Pextend = Chr(3) + Chr(3) + Chr(95) + "extend" + Chr(13)<BR> Set ButtonObject(9) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "延伸", "延伸", Pextend)<BR> Dim Pmove As String<BR> Pmove = Chr(3) + Chr(3) + Chr(95) + "move" + Chr(13)<BR> Set ButtonObject(10) = ToolbarObject.AddToolbarButton(ToolbarObject.Count + 1, "移动", "移动", Pmove)<BR> SmallBitmapName(1) = "C:\Program Files\AutoCAD 2004\New Folder\POpen.BMP"<BR> SmallBitmapName(2) = "C:\Program Files\AutoCAD 2004\New Folder\Psave.BMP"<BR> SmallBitmapName(3) = "C:\Program Files\AutoCAD 2004\New Folder\Pprinter.BMP"<BR> SmallBitmapName(4) = "C:\Program Files\AutoCAD 2004\New Folder\Pcut.BMP"<BR> SmallBitmapName(5) = "C:\Program Files\AutoCAD 2004\New Folder\Pcopy.BMP"<BR> SmallBitmapName(6) = "C:\Program Files\AutoCAD 2004\New Folder\Ppaste.BMP"<BR> SmallBitmapName(7) = "C:\Program Files\AutoCAD 2004\New Folder\Pdd.BMP"<BR> SmallBitmapName(8) = "C:\Program Files\AutoCAD 2004\New Folder\Pcj.BMP"<BR> SmallBitmapName(9) = "C:\Program Files\AutoCAD 2004\New Folder\Pys.BMP"<BR> SmallBitmapName(10) = "C:\Program Files\AutoCAD 2004\New Folder\Pmove.BMP"<BR> 谢谢朋友:
不过我还有个问题请教:
就是用菜单控制autcad自定义工具条的显示与隐藏,另在菜单条的旁边作个显示或隐藏的标记,比如工具条显示时,对应菜单左边打个对号,反之,隐藏时,对应菜单左边就没了对号?
谢谢
lgc 请问朋友:子定义的菜单项可以调用自定义的过程函数吗?快捷菜单如何制作? 请问如何可以控制菜单项的可用性?? 如果让系统启动就自动加载呢?
但不能重复加载.我目前使用这种办法可以自动加载,但是每次在CAD启动以后,如果在不关闭CAD的情况下,再打开另一个文件的时候就会出现重复家载的错误.
(command "-vbarun" "dots.dvb!dotsdesign.NewMenuItem")<BR>(command "-vbarun" "dots.dvb!dotsdesign.NewMenuToolbar") 谢谢kevinchan,
我现在比较困惑的是:假如已加载的工具条被关闭后,怎么能让它通过菜单让它可见.我试了重复加载,但不管用.是不是得用:menutoolbar.visual实现呢?我实在想不出来!!!
lgc 在CAD的工具栏\自定义。。。,点击你的工具条名
页:
[1]
2