共用方式為


COleControl::GetStockTextMetrics

Measures the text metrics for the control's stock Font property, which can be selected with the SelectStockFont function.

void GetStockTextMetrics(
   LPTEXTMETRIC lptm 
);

Parameters

Remarks

The GetStockTextMetrics function will initialize the TEXTMETRIC structure pointed to by lptm with valid metrics information if successful, or fill the structure with zeros if not successful. 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 SelectStockFont function is called. You should call this function only after selecting the stock font to assure the information it provides is valid.

Requirements

Header: afxctl.h

See Also

Reference

COleControl Class

Hierarchy Chart

Other Resources

COleControl Members