Bab I
Bab I
com
Menyediakan Informasi dan
Pengetahuan
Seputar dunia TIK
BAB I Kunjngi Ya.....
mailto:[email protected]?subject=I
Visual Basic 6 nformasi dan Pengetahuan
Launching ChanelPacitan
Sekarang kita akan belajar cara membuat Game Puzzle dengan VB6
Full Versio / Portable sama saja
Buka VB6.exe
Klik New Project
Beri nama Project nya (PrjPuzzle)
Next Step
Tambahkan 1 Form beri nama FrmPuzzle
Rincian Form di bawah
arr(0, 0) = f
arr(2, 2) = h
arr(0, 1) = c
arr(1, 2) = a
arr(2, 0) = g
arr(1, 1) = d
arr(2, 1) = b
arr(0, 2) = i
arr(1, 0) = e
P1.Caption = arr(0, 0)
P2.Caption = arr(0, 1)
P3.Caption = arr(0, 2)
P4.Caption = arr(1, 0)
P5.Caption = arr(1, 1)
P6.Caption = arr(1, 2)
P7.Caption = arr(2, 0)
P8.Caption = arr(2, 1)
P9.Caption = arr(2, 2)
End Sub
End If
If P4.Caption = "" Then
LblJmlPIndah.Caption = LblJmlPIndah.Caption + 1
Call Pindah_Bawah(P1, P4)
End If
End Sub
P1.Caption = arr(0, 0)
P2.Caption = arr(0, 1)
P3.Caption = arr(0, 2)
P4.Caption = arr(1, 0)
P5.Caption = arr(1, 1)
P6.Caption = arr(1, 2)
P7.Caption = arr(2, 0)
P8.Caption = arr(2, 1)
P9.Caption = arr(2, 2)
P9.BackColor = &HFF&
End Sub
Klik dua kali Pada Module dan isikan Code di bawah ini ke Module
Public arr(0 To 2, 0 To 2) As Variant
Function Pindah_Kiri(P1 As CommandButton, P2 As CommandButton)
P1.Caption = P2.Caption
P2.Caption = ""
P2.BackColor = &HFF&
P1.BackColor = &H8000000F
End Function
Function Pindah_Kanan(P1 As CommandButton, P2 As CommandButton)
P2.Caption = P1.Caption
P1.Caption = ""
P1.BackColor = &HFF&
P2.BackColor = &H8000000F
End Function
Function Pindah_Atas(P3 As CommandButton, P4 As CommandButton)
P3.Caption = P4.Caption
P4.Caption = ""
P4.BackColor = &HFF&
P3.BackColor = &H8000000F
End Function
Function Pindah_Bawah(P3 As CommandButton, P4 As CommandButton)
P4.Caption = P3.Caption
P3.Caption = ""
P3.BackColor = &HFF&
P4.BackColor = &H8000000F
End Function