VB开发平台的组成 ?

来源:百度知道 编辑:UC知道 时间:2024/05/15 16:06:54
知道滴高手告诉小弟一下。。
在次谢谢…………

VB编程实例
--------------------------------------------------------------------------------

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("vb.commandButton", "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 Sub cmd_test_Click()
If NewButton Is Nothing T