form1.frm

来自「vb精彩编程希望大家有用」· FRM 代码 · 共 75 行

FRM
75
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3135
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4545
   LinkTopic       =   "Form1"
   ScaleHeight     =   3135
   ScaleWidth      =   4545
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      Height          =   495
      Left            =   3120
      TabIndex        =   1
      Top             =   2400
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "Label2"
      Height          =   495
      Left            =   1680
      TabIndex        =   2
      Top             =   1320
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "按鼠标右键出现弹出式菜单"
      Height          =   255
      Left            =   1200
      TabIndex        =   0
      Top             =   600
      Width           =   2175
   End
   Begin VB.Menu formcolor 
      Caption         =   "窗体颜色"
      Visible         =   0   'False
      Begin VB.Menu red 
         Caption         =   "红色"
      End
      Begin VB.Menu green 
         Caption         =   "绿色"
      End
      Begin VB.Menu blue 
         Caption         =   "蓝色"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub blue_Click()
    Label2.Caption = "蓝色窗体"
    Form1.BackColor = vbBlue
End Sub
Private Sub Command1_Click()
    Unload Me
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button And vbRightButton Then
        PopupMenu formcolor
    End If
End Sub
Private Sub green_Click()
    Label2.Caption = "绿色窗体"
    Form1.BackColor = vbGreen
End Sub
Private Sub red_Click()
    Label2.Caption = "红色窗体"
    Form1.BackColor = vbRed
End Sub

⌨️ 快捷键说明

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