cad2006中如何一次打开多个工具栏? 对上面的程序进行了一些小的修改,重新说明如下: 窗体代码如下: \'打开某个工具栏 sub toolbars(item, keyword1) thisdrawing.sendcommand "(command ""-toolbar"" item keyword1)" & vbcr end sub \'关闭某个工具栏 sub toolbarh(item, keyword2) thisdrawing.sendcommand "(command ""-toolbar"" item keyword2)" & vbcr end sub \'显示全部工具栏 private sub commandbutton1_click() userform1.hide thisdrawing.sendcommand "-toolbar" & vbcr & "all" & vbcr & "s" & vbcr userform1.show end sub \'隐藏全部工具栏 private sub commandbutton2_click() userform1.hide thisdrawing.sendcommand "-toolbar" & vbcr & "all" & vbcr & "h" & vbcr userform1.show end sub \'打开或关闭某些工具栏 private sub commandbutton3_click() userform1.hide if optionbutton1 then thisdrawing.sendcommand "(setq keyword1 ""s"")" & vbcr thisdrawing.sendcommand "(setq keyword2 ""h"")" & vbcr elseif optionbutton2 then thisdrawing.sendcommand "(setq keyword1 ""h"")" & vbcr thisdrawing.sendcommand "(setq keyword2 ""s"")" & vbcr end if dim objectcontrol as control n = 0 for each objectcontrol in controls if typeof objectcontrol is checkbox then n = n + 1 if n 30 then exit for \'30为复选框控件的个数 thisdrawing.sendcommand "(setq item (getstring t ""输入工具栏名称:""))" & vbcr & objectcontrol.caption & vbcr if objectcontrol.value = true then call toolbars(item, keyword1) else call toolbarh(item, keyword2) end if end if next debug.print n userform1.show end sub \'退出 private sub commandbutton4_click() end end sub thisdrawing中的代码如下: sub call_toolbar() userform1.show end sub sub load() end sub 如能实现逐个动态变化就更好了。查看更多