📄 clmessageaffiche.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clMessageAffiche"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private fTime As frmTime
Private WithEvents mwtmrMessage As Timer
Attribute mwtmrMessage.VB_VarHelpID = -1
Public strText As String
Event MessageReady()
Private Sub Class_Initialize()
'创建frmTime类型的窗体,
'并从中引用公布消息的时间对象。
Set fTime = New frmTime
Load fTime
Set mwtmrMessage = fTime.tmrMessage
End Sub
Private Sub Class_Terminate()
'卸载公布消息的时间对象,
'卸载frmTime类型的窗体。
Set mwtmrMessage = Nothing
Unload fTime
Set fTime = Nothing
End Sub
Private Sub mwtmrMessage_Timer()
'公布消息
Dim strNextLine As String, strTotalLine As String
'读文件
Open App.Path & "\Message.txt" For Input As #1
Do Until EOF(1)
Line Input #1, strNextLine
strTotalLine = strTotalLine & strNextLine & Chr(13) & Chr(10)
Loop
Close #1
strText = strTotalLine
'激活发布消息事件
RaiseEvent MessageReady
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -