Is it possible to change the color of a form view depending on value?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcupito
    Contributor
    • Aug 2013
    • 294

    Is it possible to change the color of a form view depending on value?

    I've a formview that displays the results of a query based on the criteria typed into a textbox. It works magically. I would like to, however, change the color of the formview to red or green based on the values inside the form view.

    For example:

    Rating: 4.0
    Course Number: MGMT 2080


    Those are inside the form view. I essentially want,

    If rating >= 3.5 Then
    FormView.Color = Green
    End If

    Is this possible?
  • Falkeli
    New Member
    • Feb 2012
    • 19

    #2
    Code:
    if (rating>=3.5)
        form.BackColor = System.Drawing.Color.Red;
    If the condition is in a method of the form, replace the word "form" with "this"; if it's elsewhere, use a variable refering to the form.

    Comment

    Working...