Share via


CMFCMenuButton::SizeToContent

Changes the size of the button according to its text size and image size.

virtual CSize SizeToContent(
   BOOL bCalcOnly = FALSE
);

Parameters

  • [in] bCalcOnly
    A Boolean parameter that indicates whether this method resizes the button .

Return Value

A CSize object that specifies the new size for the button.

Remarks

If you call this function and bCalcOnly is TRUE, SizeToContent will calculate only the new size of the button.

The new size of the button is calculated to fit the button text, image, and arrow. The framework also adds in predefined margins of 10 pixels for the horizontal edge and 5 pixels for the vertical edge.

Requirements

Header: afxmenubutton.h

See Also

Reference

CMFCMenuButton Class

Hierarchy Chart