How to ADD and DELETE VB.Shape controls at RunTime
Posted on 2004-04-11
Hello, I have the following code that instantiates a Single VB.Shape control at runtime:
Dim WithEvents mShape1 As VB.Shape
Private Sub Command1_Click()
Set mShape1 = Controls.Add("VB.Shape", "mShape1")
mShape1.Visible = True
This crashes when I try adding a second Shape. What I am trying to do is add as many Shapes as needed AND to delete them individually when they are no longer required.
I think I need a Control Array but not sure how to set this up.