CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

标签属性 (ActiveX)

2023-1-3 13:02| 发布者: admin| 查看: 460| 评论: 0|来自: AutoCAD

摘要: 指定向用户显示的菜单项的内容和格式。

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

支持的平台:仅窗口

签名

工 务 局:

object.Label
对象

类型:弹出菜单项

此属性适用的对象。

属性值

只读:

类型:字符串

弹出菜单项的标签。

言论

与属性不同,此属性可以包含 DIESEL 字符串表达式,这些表达式在每次显示标签时有条件地更改标签。Caption

例子

工 务 局:

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

Visual 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-5-11 15:42

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部