Solved

Dynamically Add Global Array Items to Checklist in UserControl

Posted on 2013-02-05
1
399 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 250 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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