Solved

Dynamically Add Global Array Items to Checklist in UserControl

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now