Gambas France BETA


Pas de compte ? Incription

Coloring the grid of GridView object

1
AuteurMessages
vuott#1 Posté le 24/6/2015 à 22:48:41
Ne cedere ineluctabili possimusHello,

you know that the grid color of the object "GridView" is always gray, and it can not be changed.
Well, but there is a way: "GridView" is also composed of an object "child", and it's a "ScrollArea".
Infact, if we test this code:
1
2
3
4
5
6
7
8
9
PUBLIC SUB Form_Open()

DIM ob AS OBJECT

FOR EACH ob IN GridView1.Children
PRINT ob.Name
NEXT

END

in console we'll have: ScrollArea, and this object creates the grid of the GridView object.


So, we can assign a color value to "GridView.Children[0].Background" property.

Example:
1
2
3
4
5
6
7
8
9
PUBLIC SUB Form_Open()

WITH GridView1
.Columns.Count = 4
.Rows.Count = 4
.Children[0].Background = Color.Red
END WITH

END
« Vita non suavis esse potest, nec Mors amara. »
noucom#2 Posté le 24/6/2015 à 23:51:58
yes, and if you put
1
Color.blue
, you will have green grid.
vuott#3 Posté le 25/6/2015 à 13:33:18
Ne cedere ineluctabili possimus
yes, and if you put
1
Color.blue
, you will have green grid.




No, I see my grid is "blue".
« Vita non suavis esse potest, nec Mors amara. »
1