by Vince Deno (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 13th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Quick and easy way to snap objects onto a predefined spot... I often use frames and other containers to group together controls which will be
API Declarations
SNAP_LOWER_LEFT
SNAP_LOWER_RIGHT
SNAP_UPPER_LEFT
SNAP_UPPER_RIGHT
End Enum
SnapPosition As SNAP_POSITIONS, Optional bShowAfterMove As Boolean = False)
On Error Resume Next
oObject.Visible = False
Select Case SnapPosition
Case SNAP_LOWER_RIGHT
oObject.Top = linePointer.Y1 - oObject.Height
oObject.Left = linePointer.X1 - oObject.Width
Case SNAP_UPPER_RIGHT
oObject.Top = linePointer.Y1
oObject.Left = linePointer.X1 - oObject.Width
Case SNAP_LOWER_LEFT
oObject.Top = linePointer.Y1 - oObject.Height
oObject.Left = linePointer.X1
Case SNAP_UPPER_LEFT
oObject.Top = linePointer.Y1
oObject.Left = linePointer.X1
End Select
If bShowAfterMove Then oObject.Visible = True
On Error GoTo 0
End Sub
No comments have been posted about Quick and easy way to snap objects onto a predefined spot... I often use frames and other container. Why not be the first to post a comment about Quick and easy way to snap objects onto a predefined spot... I often use frames and other container.