📄 frmnote.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmNote
BorderStyle = 1 'Fixed Single
Caption = "信息公布栏"
ClientHeight = 5085
ClientLeft = 45
ClientTop = 330
ClientWidth = 8865
Icon = "frmNote.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5085
ScaleWidth = 8865
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdClear
Caption = "清除&C"
Height = 420
Left = 45
TabIndex = 4
Top = 4635
Width = 1320
End
Begin VB.CommandButton cmdSend
Caption = "发送&S"
Enabled = 0 'False
Height = 420
Left = 6030
TabIndex = 3
Top = 4635
Width = 1320
End
Begin VB.CommandButton cmdClose
Caption = "关闭&O"
Height = 420
Left = 7470
TabIndex = 2
Top = 4635
Width = 1320
End
Begin VB.TextBox txtSend
Height = 825
Left = 45
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 3735
Width = 8790
End
Begin MSComctlLib.ListView ListView1
Height = 3705
Left = 0
TabIndex = 0
Top = 0
Width = 8835
_ExtentX = 15584
_ExtentY = 6535
View = 3
LabelEdit = 1
Sorted = -1 'True
LabelWrap = 0 'False
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "日期"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "时间"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "信息来源"
Object.Width = 2117
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "信息内容"
Object.Width = 8819
EndProperty
End
End
Attribute VB_Name = "frmNote"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Dim Conn As New ADODB.Connection
'Dim Cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Private Sub cmdClear_Click()
ListView1.ListItems.Clear
Cmd.CommandText = "Select*from Message"
Conn.Execute Cmd.CommandText
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSend_Click()
RemoteMsg "*" & txtSend.Text
txtSend.Text = ""
End Sub
Private Sub Form_Load()
Dim xItem As ListItem
On Error Resume Next
If rs.State = 1 Then
rs.Close
End If
Cmd.CommandText = "Select*from Message"
rs.OPEN Cmd, , adOpenDynamic, adLockBatchOptimistic
rs.MoveFirst
Do While Not rs.EOF
DoEvents
Set xItem = ListView1.ListItems.Add(, , rs("WDate"))
xItem.SubItems(1) = rs("WTime")
xItem.SubItems(2) = rs("Source")
xItem.SubItems(3) = rs("content")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub
Private Sub txtSend_Change()
If Len(txtSend.Text) > 0 And Not cmdSend.Enabled Then
cmdSend.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -