Font: IControlFont;
The Font property determines parameters of the font that is used to display header text.
Executing the example requires a form with the Button1 button and the DataGrid component named DataGrid1. At least one column is created in the DataGrid1 component table.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Col: IDataGridColumn;
Style: IDataGridColumnHeaderStyle;
Color1, Color2: IGxColor;
ColFont: IControlFont;
Begin
Col := DataGrid1.Columns.Item(0);
Style := Col.HeaderStyle;
//Shading
Color1 := GxColor.FromName("Red");
Color2 := GxColor.FromName("Blue");
Style.Brush := New GxLinearGradientBrush.Create(Color1, Color2, 45);
//Font
ColFont := Style.Font;
ColFont.Bold := True;
ColFont.Color := GxColor.FromName("Yellow");
ColFont.Size := 12;
//Alignment
Style.HorizontalAlignment := GxStringAlignment.Center;
Style.VerticalAlignment := GxStringAlignment.Center;
End Sub Button1OnClick;
After executing the example, pressing the button changes a formatting style of the first table column header. Gradient background shading is applied, font parameters are changed and center alignment is set.
See also: