Each rebar band can contain, among other things, an image from an associated image list. The following procedure details the necessary steps for displaying an image in a rebar band.
To display images in a rebar band
The following example assumes that an existing image list object with two images was attached to the rebar control object (m_wndReBar
). A new rebar band (defined by rbi
), containing the first image, is added with a call to InsertBand:
REBARBANDINFO rbi;
rbi.cbSize= sizeof(REBARBANDINFO);
rbi.fMask= RBBIM_BACKGROUND | RBBIM_CHILD | RBBIM_IMAGE | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_TEXT;
rbi.fStyle= RBBS_GRIPPERALWAYS;
rbi.cxMinChild= 200;
rbi.cyMinChild= 50;
rbi.lpText= "Band #1";
rbi.cch= 7;
rbi.cx= 300;
rbi.hbmBack= (HBITMAP)m_bmap3;
rbi.iImage= 0;
rbi.hwndChild= (HWND)m_wndToolBar;
BOOL bRes= m_wndReBar.InsertBand(-1, &rbi);