请用VB写一段在CAD下实现快捷菜单的程序让按俺学习学习!
看cad的帮助,却总是搞不出来。我正在用C#+ActiveX做CAD开发,发现挺麻烦的,这里大家都在用VB,只好看看VB参考一下下了。明总的书上有现成的. VB相对简单些 <P class=program>Sub Ch6_AddButton()<BR>Dim currMenuGroup As AcadMenuGroup<BR>Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)<BR><BR><BR>' 建立一个新工具栏<BR>Dim newToolbar As AcadToolbar<BR>Set newToolbar = currMenuGroup.Toolbars.Add("TestToolbar")<BR><BR><BR>' 在新工具栏上增加一个按钮<BR>Dim newButton As AcadToolbarItem<BR>Dim openMacro As String<BR><BR><BR>' 赋值这个宏的VB表达式为"ESC ESC _open "<BR>openMacro = Chr(3) + Chr(3) + Chr(95) + "open" + Chr(32)<BR>Set newButton = newToolbar.AddToolbarButton _<BR>("", "NewButton", "Open a file.", openMacro)<BR>End Sub
<P class=thetitle><BR> myfreemind发表于2004-8-1 0:17:00static/image/common/back.gifVB相对简单些
<BR>我刚学的C#,原来没做过AUTOCAD开发,懒得再搞vB,嘿嘿。 本帖最后由 作者 于 2004-8-4 21:46:04 编辑 <br /><br /> yulijin608发表于2004-8-2 17:57:00static/image/common/back.gifSub Ch6_AddButton()Dim currMenuGroup As AcadMenuGroupSet currMenuGroup = ThisDrawing.Application.MenuGroups.Item(
这里没有快捷菜单啊???
页:
[1]