Hi, Timer will solve your problem.
1) Use a flag variable that indicates bigger to smaller and smaller to bigger as form level.
Dim bBigToSmall as Boolean
Dim iNoOfTimes As Integer
Private Sub Form_Load()
bBigToSmall = False
Timer1.Interval = 100
Timer1.Enabled = False
End Sub
2) Inside timer, check the Boolean variable
Private Sub Timer1_Timer()
If bBigToSmall = False Then
Shape1.Width = Shape1.Width + 100
Shape1.Height = Shape1.Height + 100
iNoOfTimes = iNoOfTimes + 1
If iNoOfTimes = 3 Then
bBigToSmall = True
End If
Else
Shape1.Width = Shape1.Width - 100
Shape1.Height = Shape1.Height - 100
iNoOfTimes = iNoOfTimes - 1
If iNoOfTimes = 0 Then
bBigToSmall = False
End If
End If
'Random Color
Shape1.FillColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub
3) At design time change the Enabled property of the Timer to false
4) When user Select the Combobox Enable the Timer
Private Sub Combo1_Change()
Timer1.Enabled = True
End Sub
Private Sub Combo1_Click()
Combo1_Change
End Sub
5) At last when u desire Disable the timer