📄 弹出菜单.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4155
ClientLeft = 60
ClientTop = 345
ClientWidth = 3180
LinkTopic = "Form1"
ScaleHeight = 4155
ScaleWidth = 3180
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3360
Top = 3000
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Timer Timer1
Left = 120
Top = 720
End
Begin VB.PictureBox Picture1
Height = 3615
Left = 120
ScaleHeight = 3555
ScaleWidth = 2835
TabIndex = 0
Top = 240
Width = 2895
Begin VB.Timer Timer2
Left = 960
Top = 1800
End
End
Begin VB.Menu t1
Caption = "图片"
Visible = 0 'False
Begin VB.Menu t11
Caption = "加载"
Index = 0
End
Begin VB.Menu t11
Caption = "折叠"
Index = 1
End
Begin VB.Menu t11
Caption = "展开"
Index = 2
End
Begin VB.Menu t11
Caption = "退出"
Index = 3
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim w1 As Integer, w2 As Integer
Private Sub Form_Load()
w1 = Picture1.Width
w2 = Picture1.Width - Picture1.ScaleWidth
t11(1).Enabled = False
t11(2).Enabled = False
Timer1.Interval = 1
Timer1.Enabled = False
Timer2.Interval = 1
Timer2.Enabled = False
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu t1, 6
End If
End Sub
Private Sub T11_Click(Index As Integer)
Select Case Index
Case 0
CommonDialog1.ShowOpen
Picture1.Picture = LoadPicture(CommonDialog1.FileName)
t11(0).Enabled = False
t11(1).Enabled = True
Case 1
Timer1.Enabled = True
Case 2
Timer2.Enabled = True
Case 3
End
End Select
End Sub
Private Sub Timer1_Timer()
Picture1.Width = Picture1.Width - 10
If Picture1.Width <= w2 Then
Timer1.Enabled = False
t11(1).Enabled = False
t11(2).Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Picture1.Width = Picture1.Width + 10
If Picture1.Width >= w1 Then
Timer2.Enabled = False
t11(1).Enabled = True
t11(2).Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -