📄 form2.frm
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
Caption = "sz聊天"
ClientHeight = 4125
ClientLeft = 60
ClientTop = 345
ClientWidth = 4620
Icon = "Form2.frx":0000
LinkTopic = "Form1"
Picture = "Form2.frx":030A
ScaleHeight = 4125
ScaleWidth = 4620
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox textget
Height = 1335
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Top = 1080
Width = 3015
End
Begin VB.CommandButton Command3
Caption = "发送"
Height = 375
Left = 3480
TabIndex = 4
Top = 3120
Width = 975
End
Begin MSWinsockLib.Winsock Winsockclient
Left = 4080
Top = 2400
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "连接"
Height = 375
Left = 3480
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 3480
TabIndex = 2
Top = 840
Width = 1095
End
Begin VB.TextBox Textsend
Height = 375
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 3120
Width = 3135
End
Begin VB.TextBox Text1
Height = 375
Left = 120
TabIndex = 0
Top = 240
Width = 3135
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Winsockclient.Connect
End Sub
Private Sub Command3_Click()
Winsockclient.SendData Textsend.Text
Textsend.Text = ""
End Sub
Private Sub Form_Load()
Textsend.Visible = False
textget.Visible = False
Command3.Visible = False
Winsockclient.RemotePort = 1001
Winsockclient.RemoteHost = "LENOVO-DE7D1CA2."
End Sub
Private Sub Text1_Change()
Winsockclient.RemoteHost = Text1.Text
End Sub
Private Sub Winsockclient_Close()
Winsockclient.Close
End
End Sub
Private Sub winsockclient_Connect()
Textsend.Visible = True
textget.Visible = True
Command2.Visible = False
Command3.Visible = True
End Sub
Private Sub winsockclient_DataArrival(ByVal bytesTotal As Long)
Dim tmpstr As String
Winsockclient.GetData tmpstr
textget.Text = tmpstr
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -