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.

Nonzero if successful; otherwise 0.

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.

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);

Community Additions

ADD
Show: