How can i add objects such as buttons, labels or textboxes at runtime?
kinyuadave
0
Newbie Poster
Recommended Answers
Jump to PostHi
Example to adding control at runtimeOption Explicit ' Declare object variable as CommandButton. Private WithEvents cmdObject As CommandButton Private Sub Form_Load() Set cmdObject = Form1.Controls.Add("VB.CommandButton", "cmdOne") cmdObject.Visible = True cmdObject.Caption = "Dynamic CommandButton" End Sub Private Sub cmdObject_Click() MsgBox "This is a dynamically added control" …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.