|
-
May 16th, 2008, 04:12 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] Problem using dynamic integer array
I am using a 3rd-party class to create Scheduled Tasks. One of the methods of this class expected an Integer array to represent the days of the month.
For example
[VBCODE]
Dim trig As New MonthlyTrigger(Me.StartTime.Value.Hour, Me.StartTime.Value.Minute, {1,2,3,4}, MonthsOfTheYear.January)
[/CODE]
I have a form with 31 checkboxes to represent the days of the month and the user can select any or all of them. So I would like to create a sub called, say, GetMonthDays, that would check which checkboxes are checked and then build an integer array from it. However, I'm stuck.
I can use the text value of the checkbox and simply Cint/DirectCast it but how to add it to the integer array? Is there a better way to do this?
Code:
Private Function GetDaysOfTheMonth() As Integer()
Dim dom As Integer() = Nothing
For Each C As Control In gb_MonthsDays.Controls
If TypeOf C Is CheckBox Then
Dim cb As CheckBox = DirectCast(C, CheckBox)
If cb.Checked Then ??????????
End If
Next
Return dom
End Function
ManagePC - the all-in-one PC management and inventory tool
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
|