⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 这里有很多很实用的VB编程案例,方便大家学习VB.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "动态加载按钮"
   ClientHeight    =   1680
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4455
   LinkTopic       =   "Form1"
   ScaleHeight     =   1680
   ScaleWidth      =   4455
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "加载按钮"
      Height          =   495
      Left            =   240
      TabIndex        =   0
      Top             =   600
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private WithEvents NewButton As CommandButton
Attribute NewButton.VB_VarHelpID = -1
Private Sub Command1_Click()
    If NewButton Is Nothing Then
        Set NewButton = Controls.Add("VB.CommandButton", "cmdNew", Me)
        NewButton.Move Command1.Left + Command1.Width + 240, Command1.Top
        NewButton.Caption = "New Button"
        NewButton.Visible = True
    End If
End Sub


Private Sub NewButton_Click()
    MsgBox "你按下了新增的按钮"
End Sub


⌨️ 快捷键说明

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