Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Sets the icon for a caption bar.

void SetIcon(
   HICON hIcon,
   BarElementAlignment iconAlignment=ALIGN_RIGHT 

[in] hIcon

The handle to the icon to set.

[in] iconAlignment

The alignment of the icon.

Caption bars can display either icons or bitmaps. See CMFCCaptionBar::SetBitmap to find out how to display a bitmap. If you set both an icon and a bitmap, the icon is always displayed. Call CMFCCaptionBar::RemoveIcon to remove an icon from the caption bar.

The icon is aligned according to the iconAlignment parameter. It can be one of the following BarElementAlignment values:





Header: afxcaptionbar.h

© 2015 Microsoft