| WindowLeft 属性 (ActiveX) 指定应用程序窗口的左边缘。 支持的平台:仅限 Windows 属性值只读:不 类型:整数 应用程序窗口的左边缘。 言论应用程序的左边缘由主应用程序窗口的左边缘与屏幕的左边缘之间的距离表示。 此距离将建立应用程序左上角的 X 坐标。请注意,原点 (0, 0) 是左上角。 例子VBA: Sub Example_WindowLeft()
    ' This example finds the WindowLeft (X coordinate) of the top 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 WindowLeft property
    Dim currWindowLeft As Integer
    currWindowLeft = ThisDrawing.Application.WindowLeft
    MsgBox "The current value of WindowLeft is " & ThisDrawing.Application.WindowLeft, , "WindowLeft Example"
    
    ' Change the value of WindowLeft
    ThisDrawing.Application.WindowLeft = currWindowLeft + 100
    MsgBox "The new value of WindowLeft is " & ThisDrawing.Application.WindowLeft, , "WindowLeft Example"
    
    ' Reset the value of WindowLeft
    ThisDrawing.Application.WindowLeft = currWindowLeft
    MsgBox "The value of WindowLeft has been reset to " & ThisDrawing.Application.WindowLeft, , "WindowLeft Example"
    
End Sub可视化 LISP: (vl-load-com)
(defun c:Example_WindowLeft()
    ;; This example finds the WindowLeft (X coordinate) of the top 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 WindowLeft property
    (setq currWindowLeft (vla-get-WindowLeft acadObj))
    (alert (strcat "The current value of WindowLeft is " (itoa currWindowLeft)))
    
    ;; Change the value of WindowLeft
    (vla-put-WindowLeft acadObj (+ currWindowLeft 100))
    (alert (strcat "The new value of WindowLeft is " (itoa (vla-get-WindowLeft acadObj))))
    
    ;; Reset the value of WindowLeft
    (vla-put-WindowLeft acadObj currWindowLeft)
    (alert (strcat "The value of WindowLeft has been reset to " (itoa (vla-get-WindowLeft acadObj))))
) | 
 |Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-10-31 14:23
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.