打字效果文本.frm

来自「个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助」· FRM 代码 · 共 59 行

FRM
59
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2115
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2115
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   300
      Left            =   3420
      Top             =   420
   End
   Begin VB.Label Label1 
      Caption         =   "滚滚长江东逝水"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   983
      TabIndex        =   0
      Top             =   840
      Width           =   2715
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim str As String
Dim strNum As Long
Dim tempStr As String
Dim strLen As String

Private Sub Form_Load()
    str = Label1.Caption
    strLen = Len(str)
    strNum = 0
End Sub

Private Sub Timer1_Timer()
    tempStr = Left(str, strNum)
    Label1.Caption = tempStr
    strNum = strNum + 1
    If strNum > strLen Then
        strNum = 0
    End If
End Sub

⌨️ 快捷键说明

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