您的位置:首页 > 编程语言 > VB

vb 类 动态 添加 控件

2011-11-11 13:50 309 查看
引用:http://zhidao.baidu.com/question/66115499.html

clsTask
____________________________
Private lbl As Label
Private frm As Form

Public Property Let Owner(ByVal vNewValue As Form)
Set frm = vNewValue
End Property

Public Sub AddPanel(ByVal strCaptiop As String)
Set lbl = frm.Controls.Add("VB.Label", "lbl1")
lbl.Move 1000, 1000, 1000, 1000
lbl.Caption = strCaptiop
lbl.Visible = True
End Sub

form
__________
Private Sub Form_Load()

Dim a As New clsTask
a.Owner = Me
a.AddPanel ("1243")
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: