\
Inserting Buttons
Adding Resources
Bt1.Text = ""
Bt1.BackgroundImage = Nothing
End If
End Sub
Sub Fnlev1()
If Form1.b1.Text = "1" And Form1.b2.Text = "2" And Form1.b3.Text =
"3" And Form1.b4.Text = "4" And Form1.b5.Text = "5" And Form1.b6.Text
= "6" And
Form1.b7.Text = "7" And Form1.b8.Text = "8" And Form1.b9.Text
= "" Then
MsgBox("WOW! YOU WIN!!!")
End If
End Sub
Sub rLev1()
Dim ti(8), a, b, ran As Integer
Dim fg As Boolean
fg = False
a=1
ti(b) = 1
Do While a <= 8
Randomize()
ran = CInt(Int((8 * Rnd()) + 1))
For b = 1 To a
If ti(b) = ran Then
fg = True
Exit For
End If
Next
If fg = True Then
fg = False
Else
ti(a) = ran
a=a+1
End If
Loop
Form1.b1.Text = ti(1)
Form1.b1.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(1) & ".jpg")
Form1.b2.Text = ti(2)
Form1.b2.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(2) & ".jpg")
Form1.b3.Text = ti(3)
Form1.b3.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(3) & ".jpg")
Form1.b4.Text = ti(4)
Form1.b4.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(4) & ".jpg")
Form1.b5.Text = ti(5)
Form1.b5.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(5) & ".jpg")
Form1.b6.Text = ti(6)
Form1.b6.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(6) & ".jpg")
Form1.b7.Text = ti(7)
Form1.b7.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(7) & ".jpg")
Form1.b8.Text = ti(8)
Form1.b8.BackgroundImage =
System.Drawing.Image.FromFile("C:\Users\Acer E 14 Core
i5\Pictures\Picture Puzzle\" & ti(8) & ".jpg")
Form1.b9.Text = ""
End Sub
End Module
Running the program each time, the puzzle pieces are randomly arranged
Adding a menustrip
Double clicking Random and adding the random function
Double clicking View Picture and creating a function to view the panel
End If
End Sub
End Sub
End Sub