1.增加新按钮程序清单(增加新按钮.exe).docVIP

  • 9
  • 0
  • 约5.07千字
  • 约 7页
  • 2018-08-22 发布于江苏
  • 举报

1.增加新按钮程序清单(增加新按钮.exe).doc

1.增加新按钮程序清单(增加新按钮.exe)

1.增加新按钮程序清单(增加新按钮.exe) 注意:本程序较难。 指出下面所使用的新变量必须先声明,这样会自动纠错 Option Explicit 通过使用WithEvents关键字声明一个对象变量为新的命令按钮 Private WithEvents NewButton As CommandButton Private Sub cmd_add_Click() If NewButton Is Nothing Then 增加新的按钮cmdNew Set NewButton = Controls.Add(mandButton, cmdnew, Me) NewButton.Move cmd_add.Left, cmd_add.Top - 580, cmd_add.Width NewButton.Caption = 新增的按钮 NewButton.Visible = True Else MsgBox 你已经增加了新的按钮!, 0, 提示框 End If End Sub Private Sub cmd_minus_Click() If NewButton Is Nothing Then MsgBox 你没有增加新按钮!, 0, 提示框 Else Controls.Remove NewButton Set NewButton = Nothing End If End Sub Private

文档评论(0)

1亿VIP精品文档

相关文档