Option Explicit
Dim Times As Long
Private Sub START_ANIM()
Me.ScaleMode = vbPixels
With PICTLISTVIEW
.Visible = True
.ScaleMode = vbPixels
End With
Times = 1
With Timer3
.Interval = 1
.Enabled = True
End With
ySpeed = (y2 - y1) / (x2 - x1) * xSpeed
End Sub
Private Sub Command1_Click()
Call START_ANIM
End Sub
Private Sub Timer3_Timer()
With Me.PICTLISTVIEW
If .Left + xSpeed > x2 Then
.Move x1, y1
Times = Times + 1
If Times > 3 Then
Timer3.Enabled = False
.Visible = False
End If
Else
.Move .Left + xSpeed, .Top + ySpeed
End If
End With
End Sub
Option Explicit
Dim Times As Long
Private Sub START_ANIM()
Me.ScaleMode = vbPixels
With PICTLISTVIEW
.Visible = True
.ScaleMode = vbPixels
End With
Times = 1
With Timer3
.Interval = 1
.Enabled = True
End With
ySpeed = (y2 - y1) / (x2 - x1) * xSpeed
End Sub
Private Sub Command1_Click()
Call START_ANIM
End Sub
Private Sub Timer3_Timer()
With Me.PICTLISTVIEW
If .Left + xSpeed > x2 Then
.Move x1, y1
Times = Times + 1
If Times > 3 Then
Timer3.Enabled = False
.Visible = False
End If
Else
.Move .Left + xSpeed, .Top + ySpeed
End If
End With
End Sub
In effet with the First cycle i simulate to send in cart a produt, from market to cart.
But of the user want ti delete i need to simulate, from cart to market...
I Hope you undestand.
Note:
The cycle rapresent the Number of product.
From market icon to cart icon.
in module
'ANIMAZIONE
Public Const xSpeed As Single = 5
Public ySpeed As Single
' Start Position
Public Const x1 As Single = 795, y1 As Single = 145
' End position
Public Const x2 As Single = 968, y2 As Single = 145
'ANIMAZIONE in module
Option Explicit
Dim Times As Long
Private Sub START_ANIM()
Me.ScaleMode = vbPixels
With PICTLISTVIEW
.Visible = True
.ScaleMode = vbPixels
.Left = x2
End With
Times = 1
With Timer3
.Interval = 1
.Enabled = True
End With
ySpeed = (y2 - y1) / (x2 - x1) * xSpeed
End Sub
Private Sub Command1_Click()
Call START_ANIM
End Sub
Private Sub Timer3_Timer()
With Me.PICTLISTVIEW
If .Left + xSpeed > x2 Then
.Left = x1
Times = Times2 + 1
If Times > 3 Then
Timer3.Enabled = False
.Visible = False
End If
Else
'.Move .Left + xSpeed, .Top + ySpeed
.Move .Left - xSpeed, .Top - ySpeed
End If
End With
End Sub
Last edited by sal21 on 03 Mar 2022, 15:02, edited 1 time in total.