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

📄 form1.frm

📁 VB实例.一些书本上的经典例子,很有参考价值
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "图片浏览器"
   ClientHeight    =   4935
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5205
   LinkTopic       =   "Form1"
   ScaleHeight     =   4935
   ScaleWidth      =   5205
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3 
      Caption         =   "退   出"
      Height          =   375
      Left            =   3480
      TabIndex        =   3
      Top             =   4440
      Width           =   1575
   End
   Begin VB.CommandButton Command2 
      Caption         =   "清除图片"
      Height          =   375
      Left            =   1800
      TabIndex        =   2
      Top             =   4440
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开图片"
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Top             =   4440
      Width           =   1575
   End
   Begin VB.PictureBox Picture1 
      Height          =   3495
      Left            =   120
      ScaleHeight     =   3435
      ScaleWidth      =   4875
      TabIndex        =   4
      Top             =   840
      Width           =   4935
      Begin VB.HScrollBar HScroll1 
         Height          =   255
         Left            =   0
         TabIndex        =   6
         Top             =   3120
         Width           =   4335
      End
      Begin VB.VScrollBar VScroll1 
         Height          =   2895
         Left            =   4560
         TabIndex        =   7
         Top             =   0
         Width           =   255
      End
      Begin VB.PictureBox Picture2 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         ForeColor       =   &H80000008&
         Height          =   1695
         Left            =   0
         ScaleHeight     =   1665
         ScaleWidth      =   1785
         TabIndex        =   5
         Top             =   0
         Width           =   1815
      End
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "图片浏览器"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   360
      TabIndex        =   0
      Top             =   120
      Width           =   4335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Picture2.Picture = LoadPicture("c:\na_33m.jpg")
HScroll1.LargeChange = HScroll1.Max / 10
HScroll1.SmallChange = HScroll1.Max / 100
VScroll1.LargeChange = VScroll1.Max / 10
VScroll1.SmallChange = VScroll1.Max / 100
End Sub

Private Sub Command2_Click()
Picture2.Picture = LoadPicture()
Picture2.Width = Picture1.Width: Picture2.Height = Picture1.Height
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Picture1.AutoSize = False
Picture2.Width = Picture1.Width
Picture2.Height = Picture1.Height
HScroll1.Width = Picture1.Width - 315
HScroll1.Height = 255
HScroll1.Left = 0
HScroll1.Top = Picture1.Height - HScroll1.Height - 60
VScroll1.Width = 255
VScroll1.Height = Picture1.Height - 60
VScroll1.Left = Picture1.Width - VScroll1.Width - 60
VScroll1.Top = 0
End Sub

Private Sub HScroll1_Change()
Picture2.Left = -HScroll1.Value
End Sub

Private Sub VScroll1_Change()
Picture2.Top = -VScroll1.Value
End Sub

⌨️ 快捷键说明

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