Copyright © 2003-2011 MultiMedia Soft

CellsManager.CellSetLogFont method

Previous pageReturn to chapter overviewNext page

Remarks

Changes the font settings for the text of the cell identified by the UniqueID identifier.

The current font settings can be obtained using the CellsManager.CellGetLogFont method.

For further details about cells management, see the How to manage cells section

 

 

Syntax

 

[Visual Basic]

Public Function CellsManager.CellSetLogFont(UniqueID as Short, lf as Ctl3DWrapper.LOGFONT) as Boolean

 

[C#]

public bool CellsManager.CellSetLogFont(short UniqueID, Ctl3DWrapper.LOGFONT lf);

 

[C++]

public: bool CellsManager.CellSetLogFont(short UniqueID, Ctl3DWrapper.LOGFONT lf);

 

Parameter

Description

 

 

UniqueID

Numerical value representing the cell's unique identifier

lf

Address in memory of the the LOGFONT structure containing the font settings

The Managed C++ definition for the LOGFONT structure is as follows:

[StructLayout(LayoutKind::Sequential)]

__gc public class LOGFONT

{

public:

 int     lfHeight;

 int     lfWidth;

 int     lfEscapement;

 int     lfOrientation;

 int     lfWeight;

 BYTE    lfItalic;

 BYTE    lfUnderline;

 BYTE    lfStrikeOut;

 BYTE    lfCharSet;

 BYTE    lfOutPrecision;

 BYTE    lfClipPrecision;

 BYTE    lfQuality;

 BYTE    lfPitchAndFamily;

 [MarshalAs(UnmanagedType::ByValTStr, SizeConst=32)]

 String  *lfFaceName;

};

Refer to the Microsoft documentation for details about the LOGFONT structure fields.

 

 

Return value

 

Value

Meaning

 

 

False

The operation failed

True

The operation was successful

 

 

Visual Basic example

 

' obtain the current font settings

Dim lf As New Ctl3DWrapper.LOGFONT

ctl3dBtn1.CellsManager.CellGetLogFont (1000, lf)

 

' change the needed fields only

lf.lfFaceName = "Courier New";

lf.lfItalic = 1;

lf.lfHeight = 16;

lf.lfWeight = 700;

 

' send the new font settings to the control

ctl3dBtn1.CellsManager.CellSetLogFont (1000, lf)

With this code the font used to render the text of cell with UniqueID 1000 will be changed into Courier new, Italic, Bold and 16 points.

 

Visual C# example

 

// obtain the current font settings

Ctl3DWrapper.LOGFONT lf = new Ctl3DWrapper.LOGFONT ();

ctl3dBtn1.CellsManager.CellGetLogFont (1000, lf);

 

// change the needed fields only

lf.lfFaceName = "Courier New";

lf.lfItalic = 1;

lf.lfHeight = 16;

lf.lfWeight = 700;

 

// send the new font settings to the control                      

ctl3dBtn1.CellsManager.CellSetLogFont (1000, lf);

 

With this code the font used to render the text of cell with UniqueID 1000 will be changed into Courier new, Italic, Bold and 16 points.