pexam10_2.frm

来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 84 行

FRM
84
字号
VERSION 5.00
Begin VB.Form Form11 
   Caption         =   "菜单的动态修改"
   ClientHeight    =   1875
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   2940
   LinkTopic       =   "Form1"
   ScaleHeight     =   1875
   ScaleWidth      =   2940
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox Picture1 
      Height          =   1335
      Left            =   240
      ScaleHeight     =   1275
      ScaleWidth      =   1995
      TabIndex        =   0
      Top             =   120
      Width           =   2055
   End
   Begin VB.Menu Pic 
      Caption         =   "图像"
      Begin VB.Menu LoadPic 
         Caption         =   "载入"
      End
      Begin VB.Menu ClearPic 
         Caption         =   "清除"
         Enabled         =   0   'False
      End
      Begin VB.Menu ShowPic 
         Caption         =   "显示"
         Enabled         =   0   'False
      End
      Begin VB.Menu HidePic 
         Caption         =   "隐藏"
         Enabled         =   0   'False
      End
   End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub ClearPic_Click()
  Picture1.Picture = LoadPicture()
  ClearPic.Enabled = False
  LoadPic.Enabled = True
  HidePic.Enabled = False
  ShowPic.Enabled = False
End Sub

Private Sub HidePic_Click()
  Picture1.Visible = False
  ClearPic.Enabled = False
  LoadPic.Enabled = False
  HidePic.Enabled = False
  ShowPic.Enabled = True
End Sub

Private Sub Loadpic_Click()
  PicName = InputBox("请输入图像文件名")
  On Error GoTo ErrHandler
  Picture1.Picture = LoadPicture(PicName)
  ClearPic.Enabled = True
  LoadPic.Enabled = False
  HidePic.Enabled = True
  ShowPic.Enabled = False
  Exit Sub
ErrHandler:
  MsgBox ("图像加载错误")
  Exit Sub
End Sub

Private Sub ShowPic_Click()
  Picture1.Visible = True
  ClearPic.Enabled = True
  LoadPic.Enabled = False
  HidePic.Enabled = True
  ShowPic.Enabled = False
End Sub

⌨️ 快捷键说明

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