We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Sub setCheckBoxes1(ByVal strBinary As String) Try Dim cControl As Control Dim tmpBinary As String = Replace(strBinary, " ", "") Dim intLength As Integer = Len(tmpBinary) For Each cControl In Me.Controls Dim z As Integer = 0 ' FieldName # converted to int If (TypeOf cControl Is CheckBox) And cControl.Tag = "Bitmap1" Then Dim tmpBit() As String ' Make an array to store the FieldName and number tmpBit = Split(cControl.Name, "CheckBox") ' Split the field name and number into an array z = tmpBit(1) ' store the field number as an int For x As Integer = 1 To intLength ' Length of string with 0s and 1s , usually 64 If Mid(tmpBinary, x, 1) = 1 Then ' check to see if the value in strBinary is 1 CType(Me.Controls("CheckBox" & (x)), CheckBox).BackColor = Color.Red CType(Me.Controls("CheckBox" & (x)), CheckBox).Checked = True Else CType(Me.Controls("CheckBox" & (x)), CheckBox).BackColor = Color.Blue CType(Me.Controls("CheckBox" & (x)), CheckBox).Checked = False End If Next End If Next cControl Catch End Try End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.