在VB中如何动态的去生成一个Label控件

2025-05-14 15:21:03
推荐回答(1个)
回答1:

Dim l1 As Label
Set l1 = Me.Controls.Add("VB.Label", "l1")
l1.Caption = "我是动态创建的Label控件"
l1.Left = 300
l1.Top = 150
l1.Visible = True

适用于VB6