[求助]怎样加一个删除按钮(VBNETBAR)?
怎样在窗体上加一个删除按钮?如何加代码?
Option Explicit
Private WithEvents NewButton As CommandButton
Private Sub Form_Load()
If NewButton Is Nothing Then
Set NewButton = Controls.Add("VB.CommandButton", "btnNew", Form1)
NewButton.Move 100, 100, 1700, 500
NewButton.Caption = "这是新创建的按扭"
NewButton.Visible = True
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Not NewButton Is Nothing Then
Controls.Remove NewButton
Set NewButton = Nothing
End If
End Sub
Private Sub NewButton_Click()
MsgBox "这是新创建的按扭"
End Sub