📄 frmtip.frm
字号:
VERSION 5.00
Begin VB.Form frmTip
AutoRedraw = -1 'True
Caption = "日积月累"
ClientHeight = 3285
ClientLeft = 3405
ClientTop = 3390
ClientWidth = 5415
Icon = "frmTip.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3285
ScaleWidth = 5415
StartUpPosition = 2 '屏幕中心
WhatsThisHelp = -1 'True
Begin VB.CommandButton Command1
Caption = "上一条(&P)"
Height = 315
Left = 4080
TabIndex = 6
Top = 960
Width = 1095
End
Begin VB.CommandButton cmdNextTip
Caption = "下一条(&N)"
Height = 315
Left = 4080
TabIndex = 5
Top = 240
Width = 1095
End
Begin VB.CommandButton cmdOK
Cancel = -1 'True
Caption = "关闭(&C)"
Height = 315
Left = 4080
TabIndex = 4
Top = 1680
Width = 1095
End
Begin VB.CheckBox chkLoadTipsAtStartup
Caption = "启动时显示"
Height = 255
Left = 360
TabIndex = 2
Top = 2880
Value = 1 'Checked
Width = 1215
End
Begin VB.PictureBox Picture1
BackColor = &H80000005&
Height = 2595
Left = 240
Picture = "frmTip.frx":1CFA
ScaleHeight = 2535
ScaleWidth = 3555
TabIndex = 0
Top = 165
Width = 3615
Begin VB.Label lblTipText
BackColor = &H80000005&
Height = 1575
Left = 105
TabIndex = 3
Top = 720
Width = 3255
End
Begin VB.Label Label1
BackColor = &H80000005&
Caption = "您知道吗?"
Height = 255
Left = 1080
TabIndex = 1
Top = 240
Width = 2055
End
End
Begin VB.Shape Shape1
BorderColor = &H00808080&
Height = 3210
Index = 1
Left = 30
Top = 30
Width = 5325
End
Begin VB.Shape Shape1
BorderColor = &H00E0E0E0&
Height = 3210
Index = 0
Left = 45
Top = 45
Width = 5325
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
Const TIP_FILE = "Tips.mnd"
Dim CurrentTip As Long
Private Sub DoNextTip()
CurrentTip = Int((Tips.Count * Rnd) + 1)
CurrentTip = CurrentTip + 1
If Tips.Count < CurrentTip Then
CurrentTip = 1
End If
frmTip.DisplayCurrentTip
End Sub
Private Sub DoForWarzTip()
CurrentTip = Int((Tips.Count * Rnd) - 1)
CurrentTip = CurrentTip - 1
If Tips.Count < CurrentTip Then
CurrentTip = 1
End If
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
Tips.Add NextTip
Wend
Close InFile
DoNextTip
LoadTips = True
End Function
Private Sub chkLoadTipsAtStartup_Click()
SaveSetting App.EXEName, "Options", "Show Tips at Startup", chkLoadTipsAtStartup.Value
End Sub
Private Sub cmdNextTip_Click()
DoNextTip
End Sub
Private Sub cmdOK_Click()
Unload Me
End Sub
Private Sub Command1_Click()
DoForWarzTip
End Sub
Private Sub Form_Load()
Dim ShowAtStartup As Long
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
ShowAtStartup = GetSetting(App.EXEName, "Options", "Show Tips at Startup", 1)
If ShowAtStartup = 0 Then
Unload Me
Exit Sub
End If
Me.chkLoadTipsAtStartup.Value = vbChecked
Randomize
If LoadTips(App.Path & "\Data\" & TIP_FILE) = False Then
lblTipText.Caption = "" & TIP_FILE & " 文件未找到?"
End If
End Sub
Public Sub DisplayCurrentTip()
On Error Resume Next
If Tips.Count > 0 Then
lblTipText.Caption = Tips.Item(CurrentTip)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -