Share via


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

Requirements

Header: afxext.h

See Also

Reference

CBitmapButton Class

Hierarchy Chart

CBitmapButton::LoadBitmaps

CBitmapButton::SizeToContent