Partager via


CBitmapButton::SizeToContent

Appelez cette fonction pour redimensionner un bouton bitmap à la taille de la bitmap.

void SizeToContent( );

Exemple

CBitmapButton* pmyButton = new CBitmapButton();

// Create the bitmap button (must include the BS_OWNERDRAW style).
pmyButton->Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, 
   CRect(10,10,100,100), pParentWnd, 1);

// Load the bitmaps for this button.
pmyButton->LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE); 

// Resize the button to be the size of the bitmaps.
pmyButton->SizeToContent();

Configuration requise

Header: afxext.h

Voir aussi

Référence

Classe de CBitmapButton

Graphique de la hiérarchie

CBitmapButton::LoadBitmaps

CBitmapButton::AutoLoad