CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

WindowTop 属性 (ActiveX)

2024-5-18 19:22| 发布者: admin| 查看: 102| 评论: 0|原作者: admin|来自: AutoCAD

WindowTop 属性 (ActiveX)

指定应用程序窗口的上边缘。

支持的平台:仅限 Windows

签名

VBA:

object.WindowTop
对象

类型: 应用

此属性应用于的对象。

属性值

只读:

类型:整数

应用程序窗口的上边缘。

言论

应用程序的上边缘由从主应用程序窗口的上边缘到屏幕上边缘的距离决定。

此距离将建立应用程序左上角的 Y 坐标。请注意,原点 (0, 0) 是左上角。

例子

VBA:

Sub Example_WindowTop()
    ' This example finds the WindowTop (X coordinate) of the WindowTop of the
    ' AutoCAD window. It then changes that position to be 100 more
    ' than it currently is. Finally, it resets the window to the
    ' original value.
    
    ' Find the current value of the WindowTop property
    Dim currWindowTop As Integer
    currWindowTop = ThisDrawing.Application.WindowTop
    MsgBox "The current value of WindowTop is " & ThisDrawing.Application.WindowTop, , "WindowTop Example"
    
    ' Change the value of WindowTop
    ThisDrawing.Application.WindowTop = currWindowTop + 100
    MsgBox "The new value of WindowTop is " & ThisDrawing.Application.WindowTop, , "WindowTop Example"
    
    ' Reset the value of WindowTop
    ThisDrawing.Application.WindowTop = currWindowTop
    MsgBox "The value of WindowTop has been reset to " & ThisDrawing.Application.WindowTop, , "WindowTop Example"
    
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_WindowTop()
    ;; This example finds the WindowTop (X coordinate) of the WindowTop of the
    ;; AutoCAD window. It then changes that position to be 100 more
    ;; than it currently is. Finally, it resets the window to the
    ;; original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Find the current value of the WindowTop property
    (setq currWindowTop (vla-get-WindowTop acadObj))
    (alert (strcat "The current value of WindowTop is " (itoa currWindowTop)))
    
    ;; Change the value of WindowTop
    (vla-put-WindowTop acadObj (+ currWindowTop 100))
    (alert (strcat "The new value of WindowTop is " (itoa (vla-get-WindowTop acadObj))))
    
    ;; Reset the value of WindowTop
    (vla-put-WindowTop acadObj currWindowTop)
    (alert (strcat "The value of WindowTop has been reset to " (itoa (vla-get-WindowTop acadObj))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 12:50

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部