工具条中的分隔符的设置问题?
<p>如下面的程序,设置有两个按钮的工具条,第一个按钮是打开文件,第二个是删除物体,</p><p>在两个按钮中间放一个分隔符。</p><p>设置好后,关闭AutoCAD。当再次打开AutoCAD时,工具条中就只剩下</p><p>打开文件的按钮和分隔符了,删除物体的按钮消失了。</p><p>但如果不设置分隔符,就不会产生这个问题。</p><p>不知道为什么?</p><p>Sub ToolbarButton()<br/>Dim currMenuGroup As AcadMenuGroup<br/>Dim newToolBar As AcadToolbar<br/>Dim newButton As AcadToolbarItem<br/>Dim openMacro As String<br/>Dim newToolBarSeparator As AcadToolbarItem<br/>Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")<br/>On Error Resume Next<br/>Set newToolBar = currMenuGroup.Toolbars.Add("Test")<br/>Set newToolBar = currMenuGroup.Toolbars.Item("Test")<br/>On Error GoTo 0<br/>newToolBar.Visible = True<br/>For Each newButton In newToolBar<br/>If newButton.Type = acToolbarSeparator Then<br/>newButton.Delete<br/>End If<br/>Next<br/>For Each newButton In newToolBar<br/>newButton.Delete<br/>Next<br/>openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)<br/>Set newButton = newToolBar.AddToolbarButton("", "Open", "Open a file.", openMacro)<br/>openMacro = Chr(3) & Chr(3) & Chr(95) & "erase" & Chr(32)<br/>Set newButton = newToolBar.AddToolbarButton("", "Erase", "erase object", openMacro)<br/>'''<br/>Set newToolBarSeparator = newToolBar.AddSeparator(1)<br/>'''<br/>currMenuGroup.Save acMenuFileCompiled<br/>End Sub</p>
页:
[1]