WindowLeft Property (ActiveX)

Specifies the left edge of the application window.

Supported platforms: Windows only

Signature

VBA:

object.WindowLeft
object

Type: Application

The object this property applies to.

Property Value

Read-only: No

Type: Integer

The left edge of the application window.

Remarks

The left edge of the application is represented by the distance between the left edge of the main application window and the left edge of the screen.

This distance will establish the X coordinate of the upper-left corner of the application. Note that the origin (0, 0) is the top, left corner.

Examples

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

Visual 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))))
)