⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmtip.frm

📁 一个比较完整的数据库编程技巧”洗浴管理系统“
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmTip 
   Caption         =   "日积月累"
   ClientHeight    =   4965
   ClientLeft      =   2370
   ClientTop       =   2400
   ClientWidth     =   5805
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4965
   ScaleWidth      =   5805
   StartUpPosition =   1  '所有者中心
   WhatsThisButton =   -1  'True
   WhatsThisHelp   =   -1  'True
   Begin VB.CommandButton cmdNextTip 
      Caption         =   "下一条提示(&N)"
      Height          =   375
      Left            =   2475
      TabIndex        =   2
      Top             =   4485
      Width           =   1455
   End
   Begin VB.CommandButton cmdOK 
      Cancel          =   -1  'True
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   375
      Left            =   4110
      TabIndex        =   0
      Top             =   4485
      Width           =   1455
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00FFFFFF&
      Height          =   4275
      Left            =   135
      Picture         =   "frmTip.frx":0000
      ScaleHeight     =   4215
      ScaleWidth      =   5490
      TabIndex        =   1
      Top             =   120
      Width           =   5550
      Begin VB.Label Label1 
         BackColor       =   &H00FFFFFF&
         Caption         =   "您知道吗..."
         Height          =   255
         Left            =   540
         TabIndex        =   4
         Top             =   180
         Width           =   2655
      End
      Begin VB.Label lblTipText 
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3405
         Left            =   195
         TabIndex        =   3
         Top             =   645
         Width           =   5160
      End
   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 = "XYGLXT.TXT"
' 当前正在显示的提示集合的索引。
Dim CurrentTip As Long
Dim ShowAtStartup As Long
Private Sub DoNextTip()
 '按顺序提示
  CurrentTip = CurrentTip + 1
  If Tips.Count < CurrentTip Then CurrentTip = 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
     Tips.Add NextTip
 Wend
 Close InFile
 ' 显示一条提示。
 DoNextTip
 LoadTips = True
End Function
Private Sub Form_Load()
 ' 查看在启动时是否显示
 ShowAtStartup = GetSetting(App.EXEName, "Options", "在启动时显示提示", 1)
 ' 读取注册表内计数的值
 frmTip.DisplayCurrentTip
 ' 读取提示文件并且随机显示一条提示。
 If LoadTips(App.Path & "\" & TIP_FILE) = False Then
    lblTipText.Caption = "文件 " & TIP_FILE & " 没有被找到吗? " & vbCrLf & vbCrLf & _
        "创建文本文件名为 " & TIP_FILE & " 使用记事本每行写一条提示。 " & _
        "然后将它存放在应用程序所在的目录 "
 End If
End Sub
Public Sub DisplayCurrentTip()
 If Tips.Count > 0 Then
  lblTipText.Caption = Tips.Item(CurrentTip)
 End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True
End Sub
Private Sub cmdNextTip_Click()
 '显示下一条提示
 Dim Number
 On Error GoTo Nerr:
  DoNextTip
 lblTipText.Caption = Tips.Item(CurrentTip)
Nerr:
' MsgBox "对不起,你的系统帮助文件已丢失!", , "系统提示"
End Sub
Private Sub cmdOK_Click()
 Unload Me
 frm_main.Enabled = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -