请给下面程序中的Set a(b) = Form1.Controls.Add("VB.CommandButton", "cmdNew" & b) 这一句加上说明,谢
DimbAsIntegerDima()AsCommandButtonPrivateSubCommand1_Click()ReDimPreservea(0Tob)Seta(...
Dim b As Integer
Dim a() As CommandButton
Private Sub Command1_Click()
ReDim Preserve a(0 To b)
Set a(b) = Form1.Controls.Add("VB.CommandButton", "cmdNew" & b)
a(b).Move b * 50, b * 500, 1000, 300
a(b).Visible = True
a(b).Width = Command1.Width
a(b).Height = Command1.Height
a(b).Left = Me.Left
a(b).Caption = "第" & b + 1 & "个" & "按钮"
b = b + 1
End Sub 展开
Dim a() As CommandButton
Private Sub Command1_Click()
ReDim Preserve a(0 To b)
Set a(b) = Form1.Controls.Add("VB.CommandButton", "cmdNew" & b)
a(b).Move b * 50, b * 500, 1000, 300
a(b).Visible = True
a(b).Width = Command1.Width
a(b).Height = Command1.Height
a(b).Left = Me.Left
a(b).Caption = "第" & b + 1 & "个" & "按钮"
b = b + 1
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询