5.8.frm
来自「VB6.0应用例题」· FRM 代码 · 共 92 行
FRM
92 行
VERSION 5.00
Begin VB.Form Form1
Caption = "图片框和图像框应用示例"
ClientHeight = 3480
ClientLeft = 60
ClientTop = 345
ClientWidth = 5445
LinkTopic = "Form1"
ScaleHeight = 3480
ScaleWidth = 5445
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 735
Left = 480
TabIndex = 1
Top = 2520
Width = 4095
Begin VB.CommandButton Command3
Caption = "还 原"
Height = 375
Left = 2520
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "放 大"
Height = 375
Left = 360
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "缩 小"
Height = 375
Left = 1440
TabIndex = 2
Top = 240
Width = 1095
End
End
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
Height = 1800
Left = 3480
ScaleHeight = 1740
ScaleWidth = 1140
TabIndex = 0
Top = 240
Width = 1200
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 1800
Left = 600
Picture = "5.8.frx":0000
Stretch = -1 'True
Top = 240
Width = 1800
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim n As Integer 'n记录图片框中的输出项数
Private Sub Form_Load()
n = 0 'n赋初值
End Sub
Private Sub Command1_Click() '放大
Image1.Width = Image1.Width * 1.25
Image1.Height = Image1.Height * 1.25
Picture1.Print "放大图片"
n = n + 1
If n = 10 Then Picture1.Cls: n = 0
End Sub
Private Sub Command2_Click() '缩小
Image1.Width = Image1.Width * 0.75
Image1.Height = Image1.Height * 0.75
Picture1.Print "缩小图片"
n = n + 1
If n = 10 Then Picture1.Cls: n = 0
End Sub
Private Sub Command3_Click() '还原
Picture1.Cls
Image1.Height = 1800
Image1.Width = 1800
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?