Font Property
Description
Font used to display the text / caption of a GridRecordItem.
Property Type
Read-write property
Syntax (Visual Basic)
Public Property Font() As Font
Remarks
This property allows you to change the font properties of the text / caption of a GridRecordItem when the BeforeDrawRow event is executed.
Example
Changing the font used to display text in a GridRecordItem (Visual Basic)
This sample illustrates how to change the font used to display the text in each individual GridRecordItem using the GridRecordItemMetrics object in the BeforeDrawRow event.
' This constant is declared in the General code section
Const COLUMN_MODIFIED = 4
Dim fntStrike As StdFont
' Retrieve the currently set font for text in GridRecordItems
Set fntStrike = wndGridControl.PaintManager.TextFont
' Add the strikethrough property to the current font
fntStrike.Strikethrough = True
' This event is called for each GridRecordItem in each GridRow before it is drawn
Private Sub wndGridControl_BeforeDrawRow(ByVal Row As XtremeGridControl.IGridRow, ByVal Item As XtremeGridControl.IGridRecordItem, ByVal Metrics As XtremeGridControl.IGridRecordItemMetrics)
' This block of code only executes if the GridRecordItem is in the GridColumn
' with an Index of COLUMN_MODIFIED
If (Item.Index = COLUMN_MODIFIED) Then
' If the value of the GridRecordItem is 6/18/2002, then change the font used to display
' text.
If (Item.Value = #6/18/2002#) Then
Set Metrics.Font = fntStrike
End If
End If
End Sub
See Also
- GridRecordItemMetrics Object
- GridRecordItemMetrics Text Property
- GridRecordItem Caption Property
- CaptionFont Property
- TextFont Property
- PreviewTextFont Property
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.