Change Font color in GridView

Post

Posted
Rating:
#1 (In Topic #2046)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

How can I change a colums font color

Hello all,
I hope someone smarter then myself can help.

I am using the following code to change the background of a Column as needed

Code

If TotalOfDay > 0 Then
            If TotalOfDay > global.TotalDailyTarget Then
                frmDashBoard.GridViewLast7Days.Columns[(i - 1)].Background = Color.green

            Else If TotalOfDay = global.TotalDailyTarget Then
                frmDashBoard.GridViewLast7Days.Columns[(i - 1)].Background = Color.Orange

            Else If TotalOfDay >= AllowedGapValue And TotalOfDay <= global.TotalDailyTarget Then
                frmDashBoard.GridViewLast7Days.Columns[(i - 1)].Background = Color.Yellow

            Else
                frmDashBoard.GridViewLast7Days.Columns[(i - 1)].Background = Color.red
            End If
        Else
            frmDashBoard.GridViewLast7Days.Columns[(i - 1)].Background = Color.white
        End If
But i can not work out how to set the font color (as For example on the red background black text is very hard to see my customers have said)

if someone would be as kind to show me how I can change the font color I would be most greatful.

Kind Regards
Andy

 
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Quincunxian is in the usergroup ‘Blogger’
Hi Andy.

Does the format
Gridview[RowNo , ColumnNo].Foreground = Color.Red
not work ?

Selection_001.png

This works for me with Gambas 3.21.3 on Linux Mint 22.3

Cheers - Quin.
I code therefore I am
Online now: No Back to the top
1 guest and 0 members have just viewed this.