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

📄 form1.frm

📁 人民邮电出版社《Visual Basic 6.0程序设计与开发技术大全》书中代码。
💻 FRM
字号:
VERSION 5.00
Object = "{27395F88-0C0C-101B-A3C9-08002B2F49FB}#1.1#0"; "PICCLP32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4125
   ClientLeft      =   1095
   ClientTop       =   1515
   ClientWidth     =   6120
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   4125
   ScaleWidth      =   6120
   Begin PicClip.PictureClip PictureClip1 
      Left            =   1860
      Top             =   1680
      _ExtentX        =   3519
      _ExtentY        =   3519
      _Version        =   393216
      Rows            =   4
      Cols            =   4
      Picture         =   "Form1.frx":0000
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   465
      Left            =   4920
      TabIndex        =   1
      Top             =   3360
      Width           =   945
   End
   Begin VB.CommandButton Command1 
      Caption         =   "地球转动"
      Height          =   465
      Left            =   4920
      TabIndex        =   0
      Top             =   2520
      Width           =   945
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   825
      Top             =   3300
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   420
      Stretch         =   -1  'True
      Top             =   600
      Visible         =   0   'False
      Width           =   480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim scx As Single, scy As Single
Dim sdx As Single, sdy As Single

Private Sub Command1_Click()
    Image1.Visible = -1      '使图像框可见
    Timer1.Enabled = -1      '时钟控件起作用
End Sub

Private Sub Command2_Click()
    End
End Sub

Private Sub Form_Load()
    scx = 50: scy = 75
    sdx = 50: sdy = 50
End Sub

Private Sub Timer1_Timer()
    Static i As Integer                         ' 设置静态变量索引GraphicCell
    Image1.Picture = PictureClip1.GraphicCell(i)
    i = i + 1
    If i > 15 Then i = 0
    Image1.Move Image1.Left + scx, Image1.Top + scy
    ' 若图像控件到达窗体右边界,改变scx值,使之向左移动
    If Image1.Left + Image1.Width >= ScaleWidth + ScaleLeft Then scx = -50
    ' 若图像控件到达窗体左边界,改变scx值,使之向右移动
    If Image1.Left <= 0 Then scx = 50
    ' 若图像控件到达窗体底边界,改变scy值,使之向上移动
    If Image1.Top + Image1.Height >= ScaleHeight + ScaleTop Then scy = -75
    ' 若图像控件到达窗体顶部边界,改变scy值,使之向下移动
    If Image1.Top <= 0 Then scy = 75
    ' 改变图像控件的大小
    Image1.Height = Image1.Height + sdy
    Image1.Width = Image1.Width + sdx
    If Image1.Height >= 1000 Then sdy = -50
    If Image1.Width >= 1000 Then sdx = -50
    If Image1.Height <= 200 Then sdy = 50
    If Image1.Width <= 200 Then sdx = 50
End Sub

⌨️ 快捷键说明

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