i have a code which is in the if-then-else statement...
then i want to use the select case statement...
and i dont know well on this...
hope you can help me...
the code is
Private Sub cmdGo_Click()
Dim postA As Single
Dim postB As Single
If Combo1 = 1 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postB = 5550 To 11175 Step 0.1
Shape2.Left = postB
Next
ElseIf Combo1 = 2 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postA = 4970 To 0 Step -0.1
Shape1.Left = postA
Next
ElseIf Combo1 = 3 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postA = 4970 To 0 Step -0.1
Shape1.Left = postA
Next
For postB = 5550 To 11175 Step 0.1
Shape2.Left = postB
Next
ElseIf Combo1 = 4 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postA = 4970 To 0 Step -0.1
Shape1.Left = postA
Next
For postB = 4970 To 0 Step -0.1
Shape2.Left = postB
Next
ElseIf Combo1 = 5 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postA = 5550 To 11175 Step 0.1
Shape1.Left = postA
Next
For postB = 5550 To 11175 Step 0.1
Shape2.Left = postB
Next
ElseIf Combo1 = 6 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postA = 5550 To 11175 Step 0.1
Shape1.Left = postA
Next
For postB = 5550 To 11175 Step 0.1
Shape2.Left = postB
Next
ElseIf Combo1 = 7 Then
For postA = 0 To 4970 Step 0.1
Shape1.Left = postA
Next
For postB = 11175 To 5550 Step -0.1
Shape2.Left = postB
Next
For postA = 5550 To 11175 Step 0.1
Shape1.Left = postA
Next
For postB = 5550 To 11175 Step 0.1
Shape2.Left = postB
Next
End If
End Sub
Im trying to make a program for our Physics which is collision and collision has 7 types. In every type there is an animation for two objects. That’s it!!!
Hope you can help me…
Thanks and have more powers to you all!!