Moved Event

Applies to:  Subclasser object, PowerForm control
See also:  Moving event, Resizing event, Resizing event, Event Index

Occurs when the window subclassed by a Subclasser object or PowerForm control has been moved by the user.

Syntax:

Private Sub object_Moved(ByVal NewLeft As Long, ByVal NewTop As Long)

The Moved event syntax has these parts:

Part Description
object The name of an object in the Applies to list.  If object is a SubClasser object, then the object must be declared using WithEvents.
NewLeft The distance, in pixels, from the left edge of the screen to the left edge of the dragging rectangle.
NewTop The distance, in pixels, from the top edge of the screen to the top edge of the dragging rectangle.

Remarks:

The Moved event is only raised when the window has been manually moved.  The Moved event is not raised if the window has been moved by code (eg by calling the form's Move method).

The Moved event is raised at the end of the moving operation, after the user has released the mouse button, irrespective of whether the current display settings include "Show window contents while dragging".

The values for NewLeft and NewTop cannot be modified in response to a Moved event.  To prevent the user from moving the window into a particular position, the values for NewLeft and NewTop can be modified in response to the Moving event.

Home

Copyright and Disclaimer