Beantwortet Check box colours

  • Monday, December 06, 2010 3:24 PM
     
     
    I have a form(created with infopath 2010) that has multiple good and  bad booleon questions (ie is a item good or bad) I have done this with check boxes if the box is checked then it is true and if it unchecked it is false.  I would like to highlight the box a different colour if it is true
    • Moved by kleinmaMVP Monday, December 06, 2010 3:33 PM (From:Visual Basic General)
    • Moved by Mike Walsh FIN Monday, December 06, 2010 4:20 PM InfoPath 2010 and no mention that this is with a back SP product (From:SharePoint - InfoPath Forms Services (pre-SharePoint 2010))
    •  

All Replies

  • Monday, December 06, 2010 4:08 PM
     
     Answered Has Code

    Hi,

    You can try something like this:

     

     Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, _
    
            CheckBox3.CheckedChanged, CheckBox4.CheckedChanged, CheckBox5.CheckedChanged
    
            For Each ctrl As CheckBox In Me.Controls
    
                If Not ctrl.Checked Then
    
                    ctrl.BackColor = Color.Beige
    
                Else
    
                    ctrl.BackColor = Color.Green
    
    
    
                End If
    
            Next
    
        End Sub