Link to home
Start Free TrialLog in
Avatar of steverguy
steverguy

asked on

Load my Usercontrol into a form, dynamically, and multiple times

I created a usercontrol that displays an image an properties of a specific product.  
After loading product values into an array, I would like to use the array to create instances of the usercontrol on the form, with the array values assinging the usercontrol's properties.

I created a function (i found a referance online) with the following code:
Public Sub CreateControl()      
        Dim userControl As UserControl
        userControl = New NamesControl.ProductImage
        userControl.Location(CurX, CurY)
 
End Sub

I get the following error:
Property access must assign to the property or use its value.

This is my first userControl, so i could've done somethign wrong while creating it, but my hope was that i'd be able to load the userControl and set it's properties in the above function.

This may be vague - but, any ideas what i'm doing wrong?

Thanks for your help!
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal 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
Is this the name of your user control
Avatar of steverguy
steverguy

ASKER

Thank you!  Sorry I didn't respond sooner, i'm only here 2 times per week.
No problem!
Glad I could help.
I request some one to help me in UserControls :-

Dynamically adding UserControl - Based on total number of rows returned from stored procedure.

I row returned from storedprocedure is equal to 1 usercontrol.

if 2 rows returned from storedprocedure will be equal to 2 usercontrols .. and so it will be increasing or decreasing based on number of rows returned from storedprocedure
chokka ,
This question doesn't get the attention of the community and you should create a new thread and detail your problem.