Label 属性 (ActiveX) 
指定菜单项在用户面前显示的内容和格式。 支持的平台:仅限 Windows 属性值只读:不 类型:字符串 弹出菜单项的标签。 言论与属性不同,此属性可以包含 DIESEL 字符串表达式,这些表达式在每次显示标签时都会有条件地更改标签。Caption 例子VBA: Sub Example_Label()
    ' This example iterates through the first menu in the menu bar
    ' and displays the label for each menu item.
    
    Dim menuItem As AcadPopupMenuItem
    Dim menuLabel As String
    menuLabel = ""
    
    For Each menuItem In ThisDrawing.Application.MenuBar.Item(0)
        menuLabel = menuLabel & menuItem.Label & vbCrLf
    Next menuItem
    MsgBox menuLabel
    
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_Label()
    ;; This example iterates through the first menu in the menu bar
    ;; and displays the label for each menu item.
    (setq acadObj (vlax-get-acad-object))
    
    (setq menuLabel "")
    
    (vlax-for menuItem (vla-Item (vla-get-MenuBar acadObj) 0)
        (setq menuLabel (strcat menuLabel (vla-get-Label menuItem) "\n"))
    )
    (alert menuLabel)
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 16:44
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.