Dim sl, st, i, j, p1, p2 As Integer
Dim mas(8) As myType
Sub win()
j = 0
For i = 0 To 7
If Image1(i).Enabled = False Then j = j + 1
Next i
If j = 8 Then Label1.Caption = "You win"
End Sub
Sub tikrinimas()
If (mas(j).x = Image1(j).Left) And (mas(j).y = Image1(j).Top) Then Image1(j).Enabled = False
End Sub
Private Sub Form_Load()
For i = 0 To 7
mas(i).x = Image1(i).Left
mas(i).y = Image1(i).Top
Next i
Randomize
For i = 0 To 4
p1 = Int(Rnd * 8)
p2 = Int(Rnd * 8)
sl = Image1(p1).Left
st = Image1(p1).Top
Image1(p1).Move Image1(p2).Left, Image1(p2).Top
'j = p1
'tikrinimas
Image1(p2).Move sl, st
'j = p2
'tikrinimas
Next i
For i = 0 To 7
j = i
tikrinimas
Next i
End Sub
Private Sub Image1_DragDrop(Index As Integer, Source As Control, x As Single, y As Single)
'j = Index
'Text1.Text = Index
'Text2.Text = Source.Index
sl = Source.Left
st = Source.Top
Source.Move Image1(Index).Left, Image1(Index).Top
'tikrinimas
Image1(Index).Move sl, st
j = Index
tikrinimas
j = Source.Index
tikrinimas
win
End Sub
Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
'i = Index
'Text1.Text = Index
'DragX = X
'DragY = Y
'tikrinimas
Image1(Index).Drag 1
'j = Index
'tikrinimas
End Sub
Private Sub Image1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
Image1(Index).Drag 2
'j = Index
'tikrinimas
End Sub
Private Sub Label2_Click()
End Sub
Как картинки поменять местами
У меня есть картинки их надо менять местами. Ну как пазл одна картинка должна быть разбросана а ее собишаешь потом в большую картинку