|
-
Jun 18th, 2004, 01:23 PM
#1
Thread Starter
Junior Member
multiple labels looping
This is my first project in VB.Net and am learning on the fly. Have some C++ experience.
Have a ListView of employees that user chooses and brings up a form with 46 different labels and 46 different check boxes
How do I create a looping routine that changes the labels to the values that I need, instead of changing each label manually (lblWeek01.text="01/05/2005"), (lblWeek02.text="01/10/2005")
I have an array of dates:
Public dteShiftSets(45) As Date
dteShiftSets(0) = #01/05/2005#
For intX As Integer = 1 To 45
'adds 8 days to each new element in array
dteShiftWeek(intX) = DateAdd(DateInterval.Day, 8, dteShiftWeek(intX - 1))
Next
I need to display all 46 array elements (the dates I've just assigned them) beside the corresponding checkbox
chkWeek00, chkWeek01, ... chkWeek45
Is my only option coding each label individually, ie
lblWeek00.text = dteShiftWeek(0)
lblWeek01.text = dteShiftWeek(1), etc
or is there some sort of loop that I can use that will increment the lblWeek??. The looping part is easy how do I increment the label to accept the array element (date that I've assigned)
For intX as Integer = 0 to 45
xxxxxxxxxx.text = dteShiftWeek(intX)
Next
If this was just a one timer, I would just hard code each one, but I need something similar for other parts of the program.
Any help would be appreciated
Shozy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|