📄 frmtip.frm
字号:
VERSION 5.00
Begin VB.Form frmTip
BorderStyle = 3 'Fixed Dialog
Caption = "日积月累"
ClientHeight = 3720
ClientLeft = 2355
ClientTop = 2385
ClientWidth = 6000
ClipControls = 0 'False
ControlBox = 0 'False
Icon = "frmTip.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3720
ScaleWidth = 6000
ShowInTaskbar = 0 'False
Begin VB.PictureBox PicCaption
Align = 1 'Align Top
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 720
Left = 0
Picture = "frmTip.frx":0442
ScaleHeight = 720
ScaleWidth = 6000
TabIndex = 6
TabStop = 0 'False
Top = 0
Visible = 0 'False
Width = 6000
Begin VB.PictureBox PicBorder
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 0
Picture = "frmTip.frx":16C86
ScaleHeight = 150
ScaleWidth = 1050
TabIndex = 7
TabStop = 0 'False
Top = 0
Visible = 0 'False
Width = 1050
End
End
Begin VB.CheckBox chkLoadTipsAtStartup
BackColor = &H00C0C0C0&
Caption = "在启动时显示提示(&S)"
Height = 315
Left = 120
TabIndex = 3
Top = 2940
Width = 2055
End
Begin VB.CommandButton cmdNextTip
BackColor = &H00C0C0C0&
Caption = "下一条提示(&N)"
Height = 375
Left = 4110
Style = 1 'Graphical
TabIndex = 2
Top = 600
Width = 1455
End
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
Height = 2715
Left = 150
ScaleHeight = 2655
ScaleWidth = 3675
TabIndex = 1
Top = 120
Width = 3735
Begin VB.TextBox lblTipText
BorderStyle = 0 'None
Height = 1875
Left = 240
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 5
Top = 600
Width = 3255
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "您知道吗..."
Height = 255
Left = 540
TabIndex = 4
Top = 180
Width = 2655
End
End
Begin VB.CommandButton cmdOK
BackColor = &H00C0C0C0&
Cancel = -1 'True
Caption = "确定"
Default = -1 'True
Height = 375
Left = 4080
Style = 1 'Graphical
TabIndex = 0
Top = 120
Width = 1455
End
End
Attribute VB_Name = "frmTip"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Tips As New Collection
Private m_cN2 As cNeoCaption
Const TIP_FILE = "TIPOFDAY.TXT"
Dim CurrentTip As Long
Private Sub DoNextTip()
CurrentTip = Int((Tips.Count * Rnd) + 1)
frmTip.DisplayCurrentTip
End Sub
Function LoadTips(sFile As String) As Boolean
Dim NextTip As String
Dim InFile As Integer
InFile = FreeFile
If sFile = "" Then
LoadTips = False
Exit Function
End If
If Dir(sFile) = "" Then
LoadTips = False
Exit Function
End If
Open sFile For Input As InFile
While Not EOF(InFile)
Line Input #InFile, NextTip
Dim str1 As String
Dim i As Integer
str1 = ""
For i = 2 To Len(NextTip) - 1
If Mid(NextTip, i, 1) = Chr(10) Then
str1 = str1 + Chr(13) + Chr(10)
Else
str1 = str1 + Mid(NextTip, i, 1)
End If
Next i
NextTip = str1
Tips.Add NextTip
Wend
Close InFile
DoNextTip
LoadTips = True
End Function
Private Sub chkLoadTipsAtStartup_Click()
If chkLoadTipsAtStartup.Value = 1 Then
frmSplash.Text1.Text = "Y"
hmessage = True
Else
frmSplash.Text1.Text = "N"
hmessage = False
End If
End Sub
Private Sub cmdNextTip_Click()
DoNextTip
End Sub
Private Sub cmdOK_Click()
Unload Me
End Sub
Private Sub Form_Activate()
If picname <> "" Then
PicCaption.Picture = LoadPicture(picname)
PicBorder.Picture = LoadPicture(picbname)
Skin Me, m_cN2
End If
End Sub
Private Sub Form_Load()
Set m_cN2 = New cNeoCaption
Skin Me, m_cN2
Dim ShowAtStartup As Long
Randomize
If LoadTips(App.Path & "\data\" & TIP_FILE) = False Then
lblTipText.Text = "文件 " & TIP_FILE & " 没有被找到吗? " & vbCrLf & vbCrLf & _
"创建文本文件名为 " & TIP_FILE & " 使用记事本每行写一条提示。 " & _
"然后将它存放在应用程序所在的目录 "
End If
If hmessage = True Then
chkLoadTipsAtStartup.Value = 1
Else
chkLoadTipsAtStartup.Value = 0
End If
End Sub
Public Sub DisplayCurrentTip()
If Tips.Count > 0 Then
lblTipText.Text = Tips.Item(CurrentTip)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -