上传者: cany199007152561
|
上传时间: 2023-03-07 19:53:39
|
文件大小: 251KB
|
文件类型: DOC
实现聊天的简单功能Private Sub Combo1_Click()
TxtSend.Font.Name = Combo1.Text
End Sub
Private Sub Check1_Click() '设置隶书字体
If Check1.Value = 1 Then
TxtSend.FontName = "隶书"
Else
TxtSend.FontName = "宋体"
End If
End Sub
Private Sub Check2_Click() '设置下划线字体
If Check2.Value = 1 Then
TxtSend.FontUnderline = True
Else
TxtSend.FontUnderline = False
End If
End Sub
Private Sub Check3_Click() '设置斜体字体
If Check3.Value = 1 Then
TxtSend.FontItalic = True
Else
TxtSend.FontItalic = False
End If
End Sub
Private Sub Check4_Click() '设置字体大小为18榜
If Check4.Value = 1 Then
TxtSend.FontSize = 18
Else
TxtSend.FontSize = 10
End If
End Sub
Private Sub Form_Load()
Combo1.Text = TxtSend.Font.Name ‘设置下拉框,选择更多的字体
Dim i As Integer
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next
With UDPSever ‘控件的名字为UDPSever
.RemoteHost= "172.16.50.24" ‘服务器主机IP名称
.RemotePort = 1001 ‘连接的端口号
.Bind 1002 ‘绑定到本地的端口
End With
End Sub
Private Sub txtSend_Change()
UDPSever.SendData txtSend.Text ‘在键入文本时,立即将其发送出去
End Sub
Private Sub UDPSever _DataArrival (ByVal bytesTotal As Long)
‘在服