?
Solved

Dynamically Add Global Array Items to Checklist in UserControl

Posted on 2013-02-05
1
Medium Priority
?
423 Views
Last Modified: 2013-02-09
I am planning on designing a UserControl with an empty checklist on it, compile the UserControl Library, and then at run-time spawn the UserControl and fill it with items from a globally declared array which will contain the data.

This would be called "dynamically filling a UserControl checklist", but the trick is compiling the UserControl Library in such a way to both (a) avoid compile errors, and (b) enable the checklist in the UserControl to fetch at run-time the array items from a globally declared array.
0
Comment
Question by:lep1
1 Comment
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 1000 total points
ID: 38858457
Create a property in your UserControl to receive an array of the type you want to pass:

Public Property DataArray As String()

Simply set that property from the application:

Dim yourArray As String()
'Fill the array
yourUserControl.DataArray = yourArray

In the UserControl, simply use Me.DataArray to access the data in the array.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question