📄 frm_hytz.frm
字号:
VERSION 5.00
Begin VB.Form frm_hytz
BorderStyle = 1 'Fixed Single
Caption = "会议通知管理"
ClientHeight = 3495
ClientLeft = 45
ClientTop = 330
ClientWidth = 5715
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3495
ScaleWidth = 5715
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Txt_C
Height = 300
Left = 1275
TabIndex = 18
Top = 3090
Width = 990
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frm_hytz.frx":0000
Left = 1275
List = "frm_hytz.frx":0002
Style = 2 'Dropdown List
TabIndex = 16
Top = 2700
Width = 990
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 330
Left = 4350
TabIndex = 15
Top = 3120
Width = 960
End
Begin VB.CommandButton Cmd_Ok
Caption = "发送信息"
Height = 330
Left = 3345
TabIndex = 14
Top = 3120
Width = 960
End
Begin VB.TextBox Text1
Height = 300
Index = 5
Left = 3330
TabIndex = 12
Top = 2700
Width = 990
End
Begin VB.TextBox Text1
Height = 300
Index = 4
Left = 1275
TabIndex = 10
Top = 2235
Width = 4035
End
Begin VB.TextBox Text1
Height = 300
Index = 3
Left = 1275
TabIndex = 8
Top = 1845
Width = 4035
End
Begin VB.TextBox Text1
Height = 300
Index = 2
Left = 1275
TabIndex = 6
Top = 1455
Width = 4035
End
Begin VB.TextBox Text1
Height = 300
Index = 1
Left = 1275
TabIndex = 4
Top = 1065
Width = 4035
End
Begin VB.TextBox Text1
Height = 300
Index = 0
Left = 1275
TabIndex = 2
Top = 675
Width = 4035
End
Begin VB.Label Label9
Caption = "绑定计算机"
Height = 240
Left = 360
TabIndex = 17
Top = 3165
Width = 915
End
Begin VB.Label Label8
Caption = "信息通知人"
Height = 240
Left = 2340
TabIndex = 13
Top = 2760
Width = 960
End
Begin VB.Label Label7
Caption = "信息接收人"
Height = 240
Left = 345
TabIndex = 11
Top = 2775
Width = 900
End
Begin VB.Line Line2
BorderColor = &H00008000&
X1 = 330
X2 = 5445
Y1 = 2610
Y2 = 2610
End
Begin VB.Label Label6
Caption = "大概内容"
Height = 240
Left = 345
TabIndex = 9
Top = 2280
Width = 825
End
Begin VB.Label Label5
Caption = "会议时间"
Height = 300
Left = 345
TabIndex = 7
Top = 1920
Width = 885
End
Begin VB.Label Label4
Caption = "主持人"
Height = 240
Left = 345
TabIndex = 5
Top = 1530
Width = 735
End
Begin VB.Label Label3
Caption = "会议地点"
Height = 330
Left = 345
TabIndex = 3
Top = 1140
Width = 945
End
Begin VB.Label Label2
Caption = "会议主题"
Height = 225
Left = 345
TabIndex = 1
Top = 765
Width = 825
End
Begin VB.Line Line1
BorderColor = &H00008000&
X1 = 315
X2 = 5445
Y1 = 585
Y2 = 585
End
Begin VB.Label Label1
Caption = "会议通知"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 2295
TabIndex = 0
Top = 210
Width = 1095
End
End
Attribute VB_Name = "frm_hytz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Ok_Click()
Dim StrNums As Integer
If Text1(0).Text = "" Or Text1(4).Text = "" Or Text1(5).Text = "" Or Combo1.Text = "" Then
MsgBox "重要信息不能为空值", 48, "提示信息"
Else
AdoRs.Open "select * from 会议通知 ", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
AdoRs.MoveLast
StrNums = AdoRs.Fields("ID") + 1
Else
StrNums = 1
End If
AdoRs.Close
c = MsgBox("确认发送该信息吗?", 33, "提示信息")
If c = vbOK Then
Set AdoRs = Cnn.Execute("insert into 会议通知 values(" & StrNums & ",'" & Text1(0) _
& "','" & Text1(3) & "','" & Text1(1) & "','" & Text1(2) & "','" & Text1(4) & "','" _
& STR(Date) & "','" & Combo1.Text & "','" & Text1(5) & "','0')")
MsgBox "数据发送成功完成", 64, "提示信息"
Call SendData
End If
End If
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text1(5).SetFocus
End If
End Sub
Private Sub Form_Load()
Dim j As Integer
On Error Resume Next
AdoRs.Open "select * from tb_user ", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
AdoRs.MoveFirst
Combo1.Clear
For j = 0 To AdoRs.RecordCount
Combo1.AddItem (AdoRs.Fields("user_name"))
AdoRs.MoveNext
Next j
End If
AdoRs.Close
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then
If Index = 4 Then
Combo1.SetFocus
Exit Sub
End If
End If
If Index < 7 And KeyCode = 38 Then Text1(Index - 1).SetFocus
If Index >= 0 And KeyCode = 40 Then Text1(Index + 1).SetFocus
If Index >= 0 And KeyCode = 13 Then Text1(Index + 1).SetFocus
If Index = 6 And KeyCode = 13 Then
Call Cmd_Ok_Click
End If
End Sub
Private Sub SendData()
Dim strSend As String
Dim Str_Copure As String
If Txt_C.Text = "" Then
MsgBox "输入接收信息的计算机名称"
Else
StrName = Txt_C.Text
Str_Copure = frm_Main.UDP_Data.LocalHostName '获取本地主机名
Call Send '调用用户自定义的过程
strSend = "AAA"
frm_Main.UDP_Data.SendData strSend
End If
End Sub
Private Sub Send()
On Error Resume Next
With frm_Main.UDP_Data
.RemoteHost = Txt_C '要连接的远程计算机
.RemotePort = 666 '要连接的端口。
.Bind 666 '绑定到本地的端口上。
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -