VB动态添加控件

VB动态添加控件,第1张

经验证没有错误。者森。

Private Sub Form_Load()

Set Timer1 = Controls.Add("歼培vb.timer", "首改亩Timer1")

Timer1.Enabled = True

Timer1.Interval = 1000

End Sub

Private Sub Timer1_Timer()

Label1.Caption = Timer

End Sub

Private WithEvents Object As TextBox

Private Sub Command1_Click()

For i = 1 To 3

Set Object = Form1.Controls.Add("VB.textbox", "text" &i)

With Object

.Visible = True

.Text = "搭物动唤枝判和改态文本"

.Width = 1000

.Height = 500

.Top = Form1.Height / 2 - 100

.Left = 1000 * i

End With

Next i

End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12508230.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存