CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2018 开发者帮助

Label 属性 (ActiveX)

2024-5-18 16:54| 发布者: admin| 查看: 10| 评论: 0|原作者: admin|来自: AutoCAD

Label 属性 (ActiveX)

指定菜单项在用户面前显示的内容和格式。

支持的平台:仅限 Windows

签名

VBA:

object.Label
对象

类型:PopupMenuItem

此属性应用于的对象。

属性值

只读:

类型:字符串

弹出菜单项的标签。

言论

与属性不同,此属性可以包含 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)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-6-27 15:49

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部