CMFCButton::SizeToContent

Resizes a button to contain its button text and image.

virtual CSize SizeToContent(
   BOOL bCalcOnly=FALSE 
);

Parameters

  • [in] bCalcOnly
    TRUE to calculate, but not change, the new size of the button; FALSE to change the size of the button. The default is FALSE.

Return Value

A CSize object that contains the new size of the button.

Remarks

By default, this method calculates a new size that includes a horizontal margin of 10 pixels and a vertical margin of 5 pixels.

Requirements

Header: afxbutton.h

See Also

Concepts

MFC Hierarchy Chart

Reference

CMFCButton Class