This Microsoft Developer CONSTANTS, ARRAYS AND ENUMERATIONS exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl VISUAL BASIC 2005 WINDOWS FORMS course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
A full answer to this exercise is provided as part of the training course!
| 1) | Create a new form called frmPreferences which allows a user to view the existing list of preferences: | ||
Initially there are 4 choices
|
|||
| 2) | To populate your combo box, create an array variable and populate it when the form loads: | ||
Sample code to set the data source for the combo box to be our newly populated array
|
|||
| 3) | Now add code to the Add this suggestion button such that when a user types in a new suggestion in the relevant text box, it is added to the array, and the combobox list is brought up to date: | ||
If the user clicks as shown, the array will be redimensioned and the combo box datasource reset
|
|||
|
|||
| 4) | If you have time, add a LIST button which uses a FOR EACH ... NEXT loop to accumulate the contents of the array in a string variable, then displays this (see the courseware manual for how to do this). | ||
| 5) | Close down any open forms. | ||
Thank you for showing an interest in this Visual Basic 2005 Windows Forms training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.
Recommended sites: C# corner | Computer tutorials | Training classes