CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

大按钮属性 (ActiveX)

2023-1-3 12:57| 发布者: admin| 查看: 428| 评论: 0|来自: AutoCAD

摘要: 指定工具栏按钮是大还是小。

指定工具栏按钮是大还是小。

支持的平台:仅窗口

签名

工 务 局:

object.LargeButtons
对象

类型:工具栏,工具栏

此属性适用的对象。

属性值

只读:是的;除了可读写的集合Toolbars

类型:布尔

  • True:工具栏很大。
  • False:工具栏很小。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_LargeButtons()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new Toolbar (TestMenu) and inserts a ToolBarButton
    ' into it.  It then sets the LargeButtons property to change the visible style
    ' of all the system Toolbars
    
    Dim CurrSize As Boolean, ButtonSize As String
    Dim Toolbars As AcadToolbars

    ' Make the system Toolbar buttons bigger
    Set Toolbars = ThisDrawing.Application.MenuGroups("ACAD").Toolbars
   
    ' Get current size
    CurrSize = Toolbars.LargeButtons
    
    ' Display current Toolbar size
    GoSub DISPLAY
   
    ' Toggle Toolbar size
    Toolbars.LargeButtons = Not (Toolbars.LargeButtons)
    
    ' Display current Toolbar size
    GoSub DISPLAY
    
    ' Reset to original value
    Toolbars.LargeButtons = CurrSize
    
    ' Display current Toolbar size
    GoSub DISPLAY

    Exit Sub
    
DISPLAY:
    ' Display button style
    ButtonSize = IIf(Toolbars.LargeButtons, "Large", "Normal size")
    MsgBox "We are displaying " & ButtonSize & " buttons.", vbInformation

    Return
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LargeButtons()
    ;; This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ;; It then creates a new Toolbar (TestMenu) and inserts a ToolBarButton
    ;; into it.  It then sets the LargeButtons property to change the visible style
    ;; of all the system Toolbars
    (setq acadObj (vlax-get-acad-object))
    
    ;; Make the system Toolbar buttons bigger
    (setq Toolbars (vla-get-Toolbars (vla-Item (vla-get-MenuGroups acadObj) "ACAD")))
   
    ;; Get current size
    (setq CurrSize (vla-get-LargeButtons Toolbars))
    
    ;; Display current Toolbar size
    (setq ButtonSize (if (= CurrSize :vlax-true) "Large" "Normal size"))
    (alert (strcat "We are displaying " ButtonSize " buttons."))
   
    ;; Toggle Toolbar size
    (vla-put-LargeButtons Toolbars (if (= (vla-get-LargeButtons Toolbars) :vlax-true) :vlax-false :vlax-true))
    
    ;; Display current Toolbar size
    (setq ButtonSize (if (= (vla-get-LargeButtons Toolbars) :vlax-true) "Large" "Normal size"))
    (alert (strcat "We are displaying " ButtonSize " buttons."))
    
    ;; Reset to original value
    (vla-put-LargeButtons Toolbars CurrSize)
    
    ;; Display current Toolbar size
    (setq ButtonSize (if (= CurrSize :vlax-true) "Large" "Normal size"))
    (alert (strcat "We are displaying " ButtonSize " buttons."))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 18:05

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部