Element.Move



Move(Right As Long,Left As Long,Bottom As Long,Top As Long)

Parameters

Right As Long
New position for right border of screen in pixel.
Left As Long
New position for left border of screen in pixel.
Bottom As Long
New position for lower border of screen in pixel.
Top As Long
New position for upper border of screen in pixel.
ED
not used
RT
avaliable

Remarks

This property moves the dynamic element. The parameter define the new position. Update the element after using this method.

Hint: Change the parameters Bottom and Right for correct operation.

Sample

The following example moves a Bitmap-Button down by the height of the element. If the bottom border of the picture is reached, the element is moved to the top border.

'*** Move element BITMAP_BTN_1
Public Sub LeftClickUp_Element_Move(obElem As Element)

	Dim obElement As Element
	Dim obPicture As DynPicture
	Dim nHeight As Long
	Dim nOldTop As Long

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

	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

	nHeight = (obElement.Bottom - obElement.Top)
	nOldTop = obElement.Top

	'*** moves element
	If (obElement.Bottom > obPicture.Height) Then
		obElement.Move obElement.Left, 0, obElement.Right, (nHeight)
	Else
		obElement.Move obElement.Left, obElement.Bottom, obElement.Right, 
(obElement.Bottom + nHeight)
	End If

	'*** update picture
	obElement.Update
	obPicture.Update obElement.Left, nOldTop, obElement.Right, 
(obElement.Bottom + nHeight)
	obElem.LeftClickUp
End Sub

See Also

Element