Condividi tramite


CButton::GetBitmap

Call this member function to get the handle of a bitmap, previously set with SetBitmap, that is associated with a button.

HBITMAP GetBitmap( ) const;

Return Value

A handle to a bitmap. NULL if no bitmap is previously specified.

Example

CButton myBitmapButton;

// Create a bitmap button.
myBitmapButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_BITMAP, 
   CRect(10,10,60,50), pParentWnd, 1);

// If no bitmap is defined for the button, define the bitmap to the
// system close bitmap.
if (myBitmapButton.GetBitmap() == NULL)
   myBitmapButton.SetBitmap(::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CLOSE)));

Requirements

Header: afxwin.h

See Also

Reference

CButton Class

Hierarchy Chart

CButton::SetBitmap

CBitmapButton::LoadBitmaps

Bitmaps

Other Resources

CButton Members