The program functions as follows:
On Text1 I enter a number and then I press the Command1 button. The program takes the number and separate it to its digits. For example 23 will be 2 and 3. The second digit represents one of three images: Image3 for 1, Image4 for 2 and Image5 for 3. For the first digit there is a top and left position stored in two arrays. For example if the value of the second array is 2 then we have:
tabletop(2)= 600
tableleft(2)=700
This represents shows the position in which one of the image must appear. For example for 23 (2 and 3) Image5 will go to position 2 i.e. 600 from top and 700 from right.
What I want to do is by entering a number with last digit zero for example 20, all the images that appeared in position 2 (the first digit) must be deleted (not visible)....
hope that makes sense....
Anyone can help?
CODE:
Dim tableLeft(1 To 6) As Single
Dim tableTop(1 To 6) As Single
Dim b(100) As Single
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim m As Integer
Dim c As Integer
Private Sub Command1_Click()
b(m) = Text3.Text
m = m + 1
a = b(m - 1)
Text2.Text = Right(a, 1)
Text1.Text = Left(a, 1)
If Text2.Text = 1 Then
Call sub1
Else
If Text2.Text = 2 Then
Call sub2
Else
If Text2.Text = 3 Then
Call sub3
End If
End If
End If
End Sub
Private Sub Command2_Click()
c = Text4.Text
Label1.Caption = b(c - 1)
End Sub
Private Sub Form_Load()
tableLeft(1) = 1680
tableLeft(2) = 1680
tableLeft(3) = 3120
tableLeft(4) = 1320
tableLeft(5) = 2160
tableLeft(6) = 3120
tableTop(1) = 1320
tableTop(2) = 1920
tableTop(3) = 1680
tableTop(4) = 2520
tableTop(5) = 2400
tableTop(6) = 2400
i = -1
j = -1
k = -1
m = 0
c = 1
End Sub
Public Sub sub1()
i = i + 1
a = Val(Text1.Text)
Image3(i).Left = tableLeft(a)
Image3(i).Top = tableTop(a)
Image3(i).Visible = True
End Sub
Public Sub sub2()
j = j + 1
a = Val(Text1.Text)
Image4(j).Left = tableLeft(a)
Image4(j).Top = tableTop(a)
Image4(j).Visible = True
End Sub
Public Sub sub3()
k = k + 1
a = Val(Text1.Text)
Image5(k).Left = tableLeft(a)
Image5(k).Top = tableTop(a)
Image5(k).Visible = True
End Sub