本程式轉貼自Visual Basic遊戲設計實務 位元文化 編著
若單機作業可將IP設成127.0.0.1
OnLine3_ox.frm
語法:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmOX
BackColor = &H0080C0FF&
BorderStyle = 1 '單線固定
Caption = "網路井字棋"
ClientHeight = 5505
ClientLeft = 45
ClientTop = 330
ClientWidth = 7185
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5505
ScaleWidth = 7185
StartUpPosition = 3 '系統預設值
Begin VB.CommandButton cmdQuit
Caption = "離線結束"
Height = 495
Left = 600
TabIndex = 7
Top = 2640
Width = 1095
End
Begin VB.CommandButton cmdNewRound
Caption = "新回合"
Height = 495
Left = 600
TabIndex = 6
Top = 2040
Width = 1095
End
Begin VB.CommandButton cmdClear
Caption = "清除"
Height = 375
Left = 6240
TabIndex = 5
Top = 4320
Width = 735
End
Begin VB.TextBox txtMsg
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 4
Text = "txtMsg 訊息輸入欄"
Top = 4920
Width = 5175
End
Begin VB.CommandButton cmdSend
Caption = "送出"
Height = 375
Left = 6240
TabIndex = 2
Top = 4920
Width = 735
End
Begin VB.PictureBox picCanvas
Appearance = 0 '平面
AutoRedraw = -1 'True
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2655
Left = 2280
ScaleHeight = 175
ScaleMode = 3 '像素
ScaleWidth = 175
TabIndex = 0
Top = 1080
Width = 2655
End
Begin MSWinsockLib.Winsock Winsock1
Left = 240
Top = 120
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.Label lblResult
BackColor = &H0080C0FF&
Caption = "平手"
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 2
Left = 5640
TabIndex = 15
Top = 2640
Width = 975
End
Begin VB.Label lblResult
BackColor = &H0080C0FF&
Caption = "敗 "
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 1
Left = 5640
TabIndex = 14
Top = 2160
Width = 975
End
Begin VB.Label lblResult
BackColor = &H0080C0FF&
Caption = "勝 "
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 0
Left = 5640
TabIndex = 13
Top = 1680
Width = 975
End
Begin VB.Label lblCState
Alignment = 2 '置中對齊
BackColor = &H00C0FFC0&
Caption = "lblCState連結狀態"
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 12
Top = 3360
Width = 1815
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H0080C0FF&
Caption = "你的戰績"
BeginProperty Font
Name = "新細明體"
Size = 14.25
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 285
Left = 5520
TabIndex = 11
Top = 1200
Width = 1140
End
Begin VB.Label lblYourName
BackColor = &H00C00000&
Caption = "lblYourName暱稱"
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 255
Left = 2640
TabIndex = 10
Top = 3960
Width = 1935
End
Begin VB.Label lblOnesName
BackColor = &H00000000&
Caption = "lblOnesName暱稱"
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Left = 2640
TabIndex = 9
Top = 600
Width = 1935
End
Begin VB.Label lblMsg
Alignment = 2 '置中對齊
BackColor = &H0000FFFF&
Caption = "lblMsg遊戲狀態"
BeginProperty Font
Name = "新細明體"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 5160
TabIndex = 8
Top = 3360
Width = 1815
End