Link to home
Start Free TrialLog in
Avatar of steverguy
steverguy

asked on

Referring to Dynamically loaded UserControl in VB.NET

if I have this code:

for x = 0 to totalPics
     Me.TabPage2.Controls.Add(New NamesControl.ProductImage)
next

How would I refer the the created control?
Avatar of neo00000110
neo00000110
Flag of United States of America image

hi,

give the control an id when you add it to the tabpage then do.

dim control as NamesControl
control = Me.TabPage2.findcontrol("controlID")
ASKER CERTIFIED SOLUTION
Avatar of neo00000110
neo00000110
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steverguy
steverguy

ASKER

it didn't seem to like cont.id - but i was able to use cont.name.

Thanks for he help!