This documentation is archived and is not being maintained.

CBitmapButton::AutoLoad

Associates a button in a dialog box with an object of the CBitmapButton class, loads the bitmap(s) by name, and sizes the button to fit the bitmap.

BOOL AutoLoad(
   UINT nID,
   CWnd* pParent 
);

Parameters

nID
The button's control ID.
pParent
Pointer to the object that owns the button.

Return Value

Nonzero if successful; otherwise 0.

Remarks

Use the AutoLoad function to initialize an owner-draw button in a dialog box as a bitmap button. Instructions for using this function are in the remarks for the CBitmapButton class.

Example

CBitmapButton myButton;

// Initialize the owner-drawn button with the id IDC_MYBUTTON as a bitmap 
// button. This code is used in the OnInitDialog handler of my dialog.
myButton.AutoLoad(IDC_MYBUTTON, this);

See Also

CBitmapButton Overview | Class Members | Hierarchy Chart | CBitmapButton::LoadBitmaps | CBitmapButton::SizeToContent

Show: