Zexor
Well-known member
- Joined
- Nov 28, 2008
- Messages
- 520
- Programming Experience
- 3-5
Say i have 100 checkboxes and i want one string to save all their status. Can this be turned into a loop?
VB.NET:
Dim startDate As String = ""
If cb1.Checked Then
startDate += "1"
Else
startDate += "0"
End If
If cb2.Checked Then
startDate += "1"
Else
startDate += "0"
End If
If cb3.Checked Then
startDate += "1"
Else
startDate += "0"
End If
If cb4.Checked Then
startDate += "1"
Else
startDate += "0"
End If
If cb5.Checked Then
startDate += "1"
Else
startDate += "0"
End If
.
.
.
.
If cb100.Checked Then
startDate += "1"
Else
startDate += "0"
End If
Last edited: