📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
BackColor = &H00FFFFC0&
Caption = "图片浏览器"
ClientHeight = 6765
ClientLeft = 60
ClientTop = 855
ClientWidth = 8145
LinkTopic = "Form3"
ScaleHeight = 12774.76
ScaleMode = 0 'User
ScaleWidth = 16505.21
StartUpPosition = 1 '所有者中心
Begin VB.FileListBox filFile
Height = 2610
Left = 480
TabIndex = 4
Top = 3360
Width = 2655
End
Begin VB.DirListBox Dir1
Height = 2400
Left = 480
TabIndex = 3
Top = 840
Width = 2655
End
Begin VB.DriveListBox drvDrive
Height = 300
Left = 480
TabIndex = 2
Top = 360
Width = 2655
End
Begin VB.Timer trmClock
Left = 3240
Top = 3720
End
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 375
Left = 5880
Picture = "Form3.frx":0000
Style = 1 'Graphical
TabIndex = 1
Top = 6120
Width = 975
End
Begin VB.CommandButton Command1
Caption = "返 回"
Height = 375
Left = 4560
Picture = "Form3.frx":09E2
Style = 1 'Graphical
TabIndex = 0
Top = 6120
Width = 975
End
Begin VB.Image Image1
Height = 5535
Left = 3960
Stretch = -1 'True
Top = 480
Width = 3855
End
Begin VB.Menu look
Caption = "视图"
Begin VB.Menu on
Caption = "上一个&O"
Shortcut = ^H
End
Begin VB.Menu next
Caption = "下一个&N"
Shortcut = ^G
End
Begin VB.Menu last
Caption = "最后一个&L"
Shortcut = ^J
End
Begin VB.Menu first
Caption = "第一个&F"
Shortcut = ^K
End
Begin VB.Menu line
Caption = "-"
End
Begin VB.Menu play
Caption = "自动播放&P"
Shortcut = {F1}
End
Begin VB.Menu seen
Caption = "浏览&S"
Shortcut = ^E
End
Begin VB.Menu End
Caption = "退出&E"
Shortcut = ^Q
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Timer1_Timer()
If lbl1.Left > 16300 Then
lbl1.Left = -8300
End If
lbl1.Move lbl1.Left + 600
End Sub
Private Sub Command1_Click()
Form3.Hide
Form1.Show
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Dir1_Change()
filFile.Path = Dir1.Path
End Sub
Private Sub drvDrive_Change()
Dir1.Path = drvDrive.Drive
End Sub
Private Sub End_Click()
End
End Sub
Private Sub filFile_Click()
ChDrive drvDrive.Drive
ChDir Dir1.Path
Image1.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
End Sub
Private Sub first_Click()
filFile.ListIndex = 0
Image1.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
MsgBox "这是第一张图片"
End Sub
Private Sub Form_Load()
filFile.Pattern = "*.bmp;*.JPG;*.ico;*.cur;*jpeg"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu look, 2
End If
End Sub
Private Sub Image1_Click()
End Sub
Private Sub last_Click()
i = filFile.ListCount - 1
filFile.ListIndex = i
Image1.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
MsgBox "这是最后一张图片"
End Sub
Private Sub next_Click()
If filFile.ListIndex < filFile.ListCount - 1 Then
Image1.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
filFile.ListIndex = filFile.ListIndex + 1
Else
MsgBox "这是最后一张图片"
End If
End Sub
Private Sub on_Click()
If filFile.ListIndex > 0 Then
Image1.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
filFile.ListIndex = filFile.ListIndex - 1
Else
MsgBox "这是第一张图片"
End If
End Sub
Private Sub play_Click()
n = InputBox$("请输入自动播放时间间隔,且间隔时间在500——65535之间")
trmClock.Enabled = True
trmClock.Interval = n
filFile.ListIndex = 0
End Sub
Private Sub seen_Click()
Form5.Show
Form5.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
End Sub
Private Sub trmClock_Timer()
If filFile.ListIndex < filFile.ListCount - 1 Then
Image1.Picture = LoadPicture(filFile.Path + "\" + filFile.FileName)
filFile.ListIndex = filFile.ListIndex + 1
Else
trmClock.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -