CellsManager.GetLogFont method
Remarks
Obtains the font settings for the text of the cell identified by the UniqueID identifier.
Syntax
Visual Basic
control.CellsManager.GetLogFont (UniqueID as integer, font as long) as boolean
Visual C++
BOOL control.CellsManager.GetLogFont (short UniqueID, long font);
|
Parameter
|
Description
|
|
|
|
|
UniqueID
|
Numerical value representing the cell's unique identifier
|
|
font
|
Address in memory of the the LOGFONTW structure (need using the UNICODE version in C++) containing the font settings. Refer to the Microsoft documentation for details about the LOGFONT structure.
|
Visual Basic example
'obtain the current font settings
Dim font As LOGFONT
MyButton.CellsManager.GetLogFont 1000, VarPtr(font)
' change the needed fields only
font.lfFaceName = "Times New Roman"
font.lfItalic = True
' send the new font settings to the control
MyButton.CellsManager.SetLogFont 1000, VarPtr(font)
With this code the font used to render the text of cell with UniqueID 1000 will be changed into Italic and Times New Roman
Visual C++ example
// must use the UNICODE version of LOGFONT
LOGFONTW font;
// obtain the current font settings
MyButton.GetCellsManager ().GetLogFont (1000, (long) &font);
// change the needed fields only
wcscpy (font.lfFaceName, L"Times New Roman");
font.lfItalic = 1;
// send the new font settings to the control
MyButton.GetCellsManager ().SetLogFont (1000, (long) &font);
With this code the font used to render the text of cell with UniqueID 1000 will be changed into Italic and Times New Roman; note that, being the control UNICODE compatible, you will need to compile your code with UNICODE or, as in the sample above, use the UNICODE version of LOGFONT (LOGFONTW).
Return value
|
Value
|
Meaning
|
|
|
|
|
FALSE
|
The operation failed
|
|
TRUE
|
The operation was successful
|