Compartilhar via


COleControl::GetFontTextMetrics

Measures the text metrics for any CFontHolder object owned by the control.

void GetFontTextMetrics( 
   LPTEXTMETRIC lptm, 
   CFontHolder& fontHolder  
);

Parameters

Remarks

Such a font can be selected with the COleControl::SelectFontObject function. GetFontTextMetrics will initialize the TEXTMETRIC structure pointed to by lptm with valid metrics information about fontHolder's font if successful, or fill the structure with zeros if not successful. You should use this function instead of GetTextMetrics when painting your control because controls, like any embedded OLE object, may be required to render themselves into a metafile.

The TEXTMETRIC structure for the default font is refreshed when the SelectFontObject function is called. You should call GetFontTextMetrics only after selecting the stock Font property to assure the information it provides is valid.

Requirements

Header: afxctl.h

See Also

Reference

COleControl Class

Hierarchy Chart