Tuesday, August 4, 2009

Working with arrays ListBox

An array can also be assigned to a variable in code. Look at the following example and understand that that is not an implicit declaration. The variable "Week" is declared as Variant. It is assigned an array value in code.



Now, when we get to the next set of controls, different kinds of Lists, these notions may prove useful.


ListBox
With the ListBox control the user can select items from a list of choices. Although the list of choices can be entered in the List property of the control, as in the example below, this is not a very good habit to get into. It is essentially "hardcoding" data into the program and it can cause maintenance headaches.



No comments:

Post a Comment