ย้ายบ้านแล้วครับ...
Group Blog
 
All Blogs
 
แจก Source Code เกมส์ Puzza

หรืออ่านบล็อกเกอร์ //thaivb6.blogspot.com/2013/04/vb6.html เรื่องเก่าของ VB6

คงไม่ต้อง Download แค่ Copy ใส่ Form VB6 เ่ท่านั้น...




Dim H As Integer
Dim OK As Boolean

Private Sub Command1_Click(Index As Integer)
If Command1(Index).Caption <> Empty Then
If Int(Index / 4) = Int(H / 4) Then
If Index + 3 = H Then
Command1(Index + 3).Caption = Command1(Index + 2).Caption
Command1(Index + 2).Caption = Command1(Index + 1).Caption
Command1(Index + 1).Caption = Command1(Index).Caption
ElseIf Index - 3 = H Then
Command1(Index - 3).Caption = Command1(Index - 2).Caption
Command1(Index - 2).Caption = Command1(Index - 1).Caption
Command1(Index - 1).Caption = Command1(Index).Caption
ElseIf Index + 2 = H Then
Command1(Index + 2).Caption = Command1(Index + 1).Caption
Command1(Index + 1).Caption = Command1(Index).Caption
ElseIf Index - 2 = H Then
Command1(Index - 2).Caption = Command1(Index - 1).Caption
Command1(Index - 1).Caption = Command1(Index).Caption
ElseIf Index + 1 = H Or Index - 1 = H Then
Command1(H).Caption = Command1(Index).Caption
End If
Command1(Index).Caption = Empty
H = Index
ElseIf Index Mod 4 = H Mod 4 Then
If Index + 12 = H Then
Command1(Index + 12).Caption = Command1(Index + 8).Caption
Command1(Index + 8).Caption = Command1(Index + 4).Caption
Command1(Index + 4).Caption = Command1(Index).Caption
ElseIf Index - 12 = H Then
Command1(Index - 12).Caption = Command1(Index - 8).Caption
Command1(Index - 8).Caption = Command1(Index - 4).Caption
Command1(Index - 4).Caption = Command1(Index).Caption
ElseIf Index + 8 = H Then
Command1(Index + 8).Caption = Command1(Index + 4).Caption
Command1(Index + 4).Caption = Command1(Index).Caption
ElseIf Index - 8 = H Then
Command1(Index - 8).Caption = Command1(Index - 4).Caption
Command1(Index - 4).Caption = Command1(Index).Caption
ElseIf Index + 4 = H Or Index - 4 = H Then
Command1(H).Caption = Command1(Index).Caption
End If
Command1(Index).Caption = Empty
H = Index
End If
OK = True
For N = 0 To 14
If Command1(N).Caption <> Trim(Str(N + 1)) Then OK = False
Next N
If OK Then MsgBox "ÊÓàÃç¨áÅéÇ": Call Form_Load
End If
End Sub

Private Sub Form_Load()
Randomize
For N = 0 To 15
Command1(N).Caption = Empty
Next N
For N = 0 To 14
Do
R = ((Rnd * 100) Mod 15)
Loop While Command1(R).Caption <> Empty
Command1(R).Caption = N + 1
Next N
H = 15
End Sub



Create Date : 13 กรกฎาคม 2554
Last Update : 4 พฤษภาคม 2556 17:09:32 น. 0 comments
Counter : 1261 Pageviews.

ธนัตถ์เดชน์
Location :
ขอนแก่น Thailand

[Profile ทั้งหมด]

ฝากข้อความหลังไมค์
Rss Feed
Smember
ผู้ติดตามบล็อก : 9 คน [?]




การเรียนรู้...ไม่มีวันจบสิ้น
Friends' blogs
[Add ธนัตถ์เดชน์'s blog to your web]
Links
 

 Pantip.com | PantipMarket.com | Pantown.com | © 2004 BlogGang.com allrights reserved.