Click or drag to resize
OGFont Class
This class represents a text font used in a grid cell.
Inheritance Hierarchy
SystemObject
  Stingray.GridOGFont

Namespace: Stingray.Grid
Assembly: Stingray.GridUtils (in Stingray.GridUtils.dll) Version: [TAG_DECIMAL_VERSION]
Syntax
[SerializableAttribute]
public class OGFont : ICloneable, ISerializable

The OGFont type exposes the following members.

Constructors
  NameDescription
Public methodOGFont
Initializes a new empty font, with no properties set.
Public methodOGFont(Font)
Creates an OGFont from a GDI+ font.
Public methodOGFont(OGFont)
Copy constructor.
Protected methodOGFont(SerializationInfo, StreamingContext)
Internal.
Public methodOGFont(String, Int32)
Initializes a new font.
Public methodOGFont(String, Int32, Int32)
Initializes a new font.
Public methodOGFont(String, Int32, Int32, Boolean, Boolean, Boolean, Boolean)
Initializes a new font.
Top
Methods
  NameDescription
Public methodChangeFont
Composes this font using a source font and a ModifyType for the operation.
Public methodClone
Creates a copy of this font.
Public methodStatic memberDefaultFont
Returns a font with all default values.
Public methodGetFontKey
Returns the hash key for this OGFont.
Public methodGetGdiPlusFont
Returns a GDI+ font equivalent to this OGFont.
Public methodGetHashCode
Computes the hash key for this OGFont.
(Overrides ObjectGetHashCode.)
Public methodGetObjectData
Internal.
Public methodIsSubSet
Indicates if this font is a subset of a specified font.
Protected methodSetBold
Internal.
Protected methodSetFaceName
Internal.
Protected methodSetItalic
Internal.
Protected methodSetOrientation
Internal.
Protected methodSetSize
Internal.
Protected methodSetStrikeOut
Internal.
Protected methodSetUnderLine
Internal.
Public methodToString
Internal.
(Overrides ObjectToString.)
Top
Fields
  NameDescription
Protected fieldincludeBold
Bold included
Protected fieldincludeFaceName
FaceName included
Protected fieldincludeItalic
Italics included
Protected fieldincludeOrientation
Orientation included
Protected fieldincludeSize
Size included
Protected fieldincludeStrikeOut
StrikeOut included
Protected fieldincludeUnderLine
UnderLine included
Top
Properties
  NameDescription
Public propertyBold
Gets a value that indicates if this font is bold.
Public propertyDescription
Internal.
Public propertyFaceName
Gets the face name for this font.
Public propertyIncludeBold
Gets or sets a value to show that the Bold property is set.
Public propertyIncludeFaceName
Gets or sets a value to show that the FaceName property is set.
Public propertyIncludeItalic
Gets or sets a value to show that the Italic property is set.
Public propertyIncludeOrientation
Gets or sets a value to show that the Orientation property is set.
Public propertyIncludeSize
Gets or sets a value to show that the Size property is set.
Public propertyIncludeStrikeOut
Gets or sets a value to show that the StrikeOut property is set.
Public propertyIncludeUnderLine
Gets or sets a value to show that the UnderLine property is set.
Public propertyIsEmpty
Indicates if the font has no properties set.
Public propertyItalic
Gets a value that indicates if this font is italicized.
Public propertyOrientation
Gets the orientation of this font.
Public propertySize
Gets the point size of this font.
Public propertyStrikeOut
Gets a value that indicates if this font is struck out.
Public propertyUnderLine
Gets a value that indicates if this font is underlined.
Top
Remarks
An instance of OGFont is available via the TextFont property on a grid Style object. The text font affects the appearance of the text in the grid cell. The following C# code shows how OGFont can be used to set the font for cell 1,1 to bold, underlined, 10pt Arial.
// Create the style, assign the font, and assign back to the grid
Style fontStyle = new Style();
fontStyle.TextFont = new OGFont("Arial", 10, 0, true, false, true, false);
fontStyle.Value = "Sample";
GridControl1[1, 1].Style = fontStyle;

// Directly assign the TextFont property of grid cell 1, 1
GridControl1[1, 1].Style.TextFont = new OGFont("Arial", 10, 0, true, false, true, false);
GridControl1[1, 1].Style.Value = "Sample";
Note: When creating a font for use in a grid cell style, only properties that are set are specifically applied to the cell's font. Any font properties that are not set are inherited from the table style. The code samples above use the OGFont constructor that sets all properties, causing the exact font to be used in the cell. If only the FaceName and Size are specified, the Orientation, Bold, Italic, UnderLine, and StrikeOut properties are inherited from the Grid's base style.
See Also