Element.Left



Left() As Long
ED
avaliable
RT
read only

Remarks

Returns the position of the left window border of the dynamic element in pixel. The value defines the distance from the left border of the screen.

Sample

The following example moves a Bitmap-Button to the right by the width of the element. If the right border of the picture is reached, the element is moved to the left border.

'*** Move picture
Public Sub LeftClickUp_Element_Move_Horizontal(obElem As Element)
	Dim obElement As Element
	Dim obPicture As DynPicture
	Dim nWidth As Long

	'*** Get picture-Object
	Set obPicture = obElem.Parent.Parent
	If (obPicture Is Nothing) Then
		MsgBox "Error: Picture-object is invalid..."
		Exit Sub
	End If

	'*** Get element BITMAP_BTN_1
	Set obElement = obPicture.Elements.Item("BITMAP_BTN_1")
	If (obElement Is Nothing) Then
		MsgBox "Error: element BITMAP_BTN_1 doesn't exists..."
		Exit Sub
	End If

	'*** moves element to top of the picture
	nWidth = (obElement.Bottom - obElement.Top)

	'*** moves element
	If (obElement.Right <= obPicture.Width) Then
		obElement.Move obElement.Right, obElement.Top, 
(obElement.Right + nWidth), obElement.Bottom
	Else
		obElement.Move obPicture.Left, obElement.Top, 
obPicture.Left + nWidth, obElement.Bottom
	End If
End Sub

See Also

Element