Impostare font, colore dei caratteri e colore di sfondo diversi per ogni cella di una GridView

Da Gambas-it.org - Wikipedia.

Mostreremo un esempio di come impostare font, colore dei caratteri (proprietà Foreground) e colore di sfondo (proprietà .Background) diversi per ogni cella in una Gridview, composta per l'occasione semplicemente da due righe e da due colonne:

Public Sub Form_Open()  
 
 
 With GridView1
   .Rows.Count = 2  
   .Columns.Count = 2
 End With
  
 With GridView1[0, 0]  
   .Foreground = Color.Red  
   .Font.Name = "sans"  
   .Text = "alibaba"  
 End With  
  
 With GridView1[0, 1]  
   .Foreground = Color.Blue  
   .Font.Name = "ubuntu"  
   .Text = "simbad"  
 End With  
  
 With GridView1[1, 0]  
   .Foreground = Color.Green  
   .Font.Name = "symbol"  
   .Font.Bold = True  
   .Text = "anqropos"  
   .Background = Color.DarkBlue  
 End With  
  
 With GridView1[1, 1]  
   .Foreground = &HFFF5EE  
   .Font.Name = "liberation mono"  
   .Text = "aladino"  
   .Background = Color.DarkBlue  
 End With  
 
End