VBA控件教程:在窗体运行时添加控件

2013-07-07 11:33 阅读 558 次 评论关闭

Private Sub UserForm_Click()
Dim mc As CommandButton
Static k
k = k + 1
Set mc = Me.Controls.Add("Forms.Commandbutton.1")
mc.Caption = k
mc.Top = Me.Controls(k - 1).Top + Me.Controls(k - 1).Height
Me.Controls.Remove "Commandbutton1"
End Sub

版权声明:本文著作权归原作者所有,欢迎分享本文,谢谢支持!
转载请注明:VBA控件教程:在窗体运行时添加控件 | 猎微网

评论已关闭!