Solved

Dynamically Add Global Array Items to Checklist in UserControl

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

747 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

15 Experts available now in Live!

Get 1:1 Help Now