- Private Sub Command1_Click()
-
- Picture1(19).Picture = Nothing
-
- x1 = 0
- y1 = 0
- x2 = 0
- y2 = 0
- For i = 0 To 18
- Select Case i
- Case 5
- y2 = ty + y2
- x2 = 0
- Case 10
- y2 = ty + y2
- x2 = 0
- Case 15
- y2 = ty + y2
- x2 = 0
- End Select
- Form1.Picture1(i).PaintPicture Form2.Image1(ID).Picture, x1, y1, tx, ty, x2, y2, tx, ty
- x2 = tx + x2
- Next
- For i = 0 To 19
- TP(i, 0) = i
- TP(i, 1) = i
- Next
- MsgBox "Commencez ?", vbQuestion
- For i = 0 To 19
- Randomize
- Rndinx = CInt(Rnd * 18)
- Rndinx2 = CInt(Rnd * 18)
- Picture2.Picture = Picture1(Rndinx).Image
- Picture1(Rndinx).Picture = Picture1(Rndinx2).Image
- Picture1(Rndinx2).Picture = Picture2.Picture
- a = TP(Rndinx2, 1)
- TP(Rndinx2, 1) = TP(Rndinx, 1)
- TP(Rndinx, 1) = a
-
- Next
- End Sub
-
- Private Sub Command2_Click()
- CommonDialog1.ShowOpen
- PictureTest.Picture = LoadPicture(CommonDialog1.FileName, , , 10, 1)
-
- End Sub
-
- Private Sub Form_Load()
- For i = 0 To 19
- Picture1(i).Enabled = False
- Next
- tx = Form1.Picture1(0).Width
- ty = Form1.Picture1(0).Height
- End Sub
-
-
- Private Sub Form_Unload(Cancel As Integer)
- End
- End Sub
-
- Private Sub menuApropos_Click()
- Form3.Show
- End Sub
-
- Private Sub menunewparti_Click()
- Form2.Show
- For i = 0 To 19
- Picture1(i).Enabled = True
- Next
- End Sub
-
- Private Sub menuquitter_Click()
- End
- End Sub
-
- Private Sub Picture1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
-
- If TP(Index, 1) = 19 Then
- Picture2.Picture = Picture1(Inx).Image
- Picture1(Inx).Picture = Picture1(Index).Image
- Picture1(Index).Picture = Picture2.Picture
- a = TP(Index, 1)
- TP(Index, 1) = TP(Inx, 1)
- TP(Inx, 1) = a
- End If
- For i = 0 To 19
- If TP(i, 0) <> TP(i, 1) Then Exit Sub
- Next
- MsgBox "Bravo !"
- End Sub
-
- Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- Label1.Width = tx
- Label1.Height = ty
- Label1.Move Picture1(Index).Left, Picture1(Index).Top, tx, ty
- Label1.Drag
- Inx = Index
- End Sub
-
Private Sub Command1_Click()
Picture1(19).Picture = Nothing
x1 = 0
y1 = 0
x2 = 0
y2 = 0
For i = 0 To 18
Select Case i
Case 5
y2 = ty + y2
x2 = 0
Case 10
y2 = ty + y2
x2 = 0
Case 15
y2 = ty + y2
x2 = 0
End Select
Form1.Picture1(i).PaintPicture Form2.Image1(ID).Picture, x1, y1, tx, ty, x2, y2, tx, ty
x2 = tx + x2
Next
For i = 0 To 19
TP(i, 0) = i
TP(i, 1) = i
Next
MsgBox "Commencez ?", vbQuestion
For i = 0 To 19
Randomize
Rndinx = CInt(Rnd * 18)
Rndinx2 = CInt(Rnd * 18)
Picture2.Picture = Picture1(Rndinx).Image
Picture1(Rndinx).Picture = Picture1(Rndinx2).Image
Picture1(Rndinx2).Picture = Picture2.Picture
a = TP(Rndinx2, 1)
TP(Rndinx2, 1) = TP(Rndinx, 1)
TP(Rndinx, 1) = a
Next
End Sub
Private Sub Command2_Click()
CommonDialog1.ShowOpen
PictureTest.Picture = LoadPicture(CommonDialog1.FileName, , , 10, 1)
End Sub
Private Sub Form_Load()
For i = 0 To 19
Picture1(i).Enabled = False
Next
tx = Form1.Picture1(0).Width
ty = Form1.Picture1(0).Height
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub menuApropos_Click()
Form3.Show
End Sub
Private Sub menunewparti_Click()
Form2.Show
For i = 0 To 19
Picture1(i).Enabled = True
Next
End Sub
Private Sub menuquitter_Click()
End
End Sub
Private Sub Picture1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
If TP(Index, 1) = 19 Then
Picture2.Picture = Picture1(Inx).Image
Picture1(Inx).Picture = Picture1(Index).Image
Picture1(Index).Picture = Picture2.Picture
a = TP(Index, 1)
TP(Index, 1) = TP(Inx, 1)
TP(Inx, 1) = a
End If
For i = 0 To 19
If TP(i, 0) <> TP(i, 1) Then Exit Sub
Next
MsgBox "Bravo !"
End Sub
Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Width = tx
Label1.Height = ty
Label1.Move Picture1(Index).Left, Picture1(Index).Top, tx, ty
Label1.Drag
Inx = Index
End Sub