Copyright © 2002-2009 MultiMedia Soft 
Return to index  
 
abmSetFontText function 
 
Remarks
Given a text position, retrieves its font settings: this information can be retrieved using the abmGetFontText function.
Return value
None.
Syntax
void abmSetFontText
HWND hWndBtn
short nPosition, 
void *pLogFont 
); 
 
 
Parameters
Description
hWndBtn
Windows handle associated to the button.
nPosition
The numeric value of the text whose font settings will be changed. Supported values are the following: 
Mnemonic constant
Meaning
TEXTPOS_CAPTION (0)
Sets the caption text font settings
TEXTPOS_LT (1)
Sets the Left-Top text font settings
TEXTPOS_CT (2)
Sets the Center-Top text font settings
TEXTPOS_RT (3)
Sets the Right-Top text font settings
TEXTPOS_LM (4)
Sets the Left-Middle text font settings
TEXTPOS_RM (5)
Sets the Right-Middle text font settings
TEXTPOS_LB (6)
Sets the Left-Bottom text font settings
TEXTPOS_CB (7)
Sets the Center-Bottom text font settings
TEXTPOS_RB (8)
Sets the Right-Bottom text font settings
pLogFont
Address of the the LOGFONT structure that contains the new font settings.
 
Visual Basic example 
 
' obtain the current font settings 
Dim lf As LOGFONT 
abmGetFontText btn1.hWnd, TEXTPOS_CAPTION, lf 
 
' change the needed fields only 
lf.lfItalic = True 
lf.lfFaceName = "Times New Roman" 
 
send the new font settings to the control 
abmSetFontText btn1.hWnd, TEXTPOS_CAPTION, lf 
With this code, after the call to the abmSetFontText function, the caption font of the button btn1 will be italic and Times New Roman. 
 
Visual C++ example 
 
// obtain the current font settings 
LOGFONT lf; 
abmGetFontText (btn1.GetSafeHwnd (), TEXTPOS_CAPTION, &lf); 
 
// change the needed fields only 
lf.lfItalic = TRUE; 
strcpy (lf.lfFaceName, "Times New Roman"); 
 
// send the new font settings to the control 
abmSetFontText (btn1.GetSafeHwnd (), TEXTPOS_CAPTION, &lf); 
his code, after the call to the abmSetFontText function, the caption font of the button btn1 will be italic and Times New Roman. 
 
 
 
 
 
 
 
Copyright © 2002-2009 MultiMedia Soft 
Return to index