Search Tools Links Login

Add a control programmatically

Posted: 2020-08-30
By: vb6boy
Viewed: 186

Filed Under:

Visual Basic 6, Visual Basic 6

No attachments for this post

Programmatically add a label to the form and set its caption

Dim objControl As Label
Set objControl = Controls.Add("VB.Label", "lblNewLabel", Me)
With objControl
   .Caption = "Add a label"
   .Left = 100
   .Top = 100
   .Visible = True
End With

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.