If I'm reading correctly and your user control is called UserControl1, it'll be UserControl11 when you drop it on a form. Once it's on a form, set its Index property = 0. That creates a control array. Once it's an array, you can use Load to load as many as required. '=============UserControl Code Option Explicit Public Event Click() Private Sub UserControl_Click() RaiseEvent Click End Sub Private Sub UserControl_Initialize() 'Give it some color so you can see it. UserControl.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) End Sub '=============Form Code Option Explicit Private Sub UserControl11_Click(Index As Integer) If Index = UserControl11.UBound Then Load UserControl11(Index + 1) With UserControl11(Index) UserControl11(Index + 1).Move .Left, .Top + .Height, .Width, .Height End With UserControl11(Index + 1).Visible = True End If End Sub
Destroyer
|