Here...for some guy on here eariler
Here is the code to put manually this will create the right code for your tool bar
Code:
if (!myToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
DB_BITMAP_TAHITI, IDB_BITMAP_TOOLBAR, 9, false) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
DB_BITMAP_TAHITI = id of the background bitmap.
IDB_BITMAP_TOOLBAR = id of the toolbar bitmap.
9 is the number of buttons of the bitmap.
false is a boolean that define if the background bitmap must be stretched if its size is different of the toolbar.
Note that TBSTYLE_FLAT will create flat format buttons... else, standard 3D buttons will be added.
Set the style of the process, IM_STRECH or IM_TRANSPARENT. IM_TRANSPARENT will take the toolbar image as it is and remove the background color. IM_STRECH stretch the bitmap to the size of the button.
Code:
<PRE>m_wndToolBar.ImageStyle = IM_TRANSPARENT;
m_wndToolBar.MaskColor = RGB(198, 195, 198);</PRE>
Define if the bitmap must be applied on the complete control frame or only on the toolbar. m_wndToolBar.all_frame = true;
You can modify the type of button with the DrawEdge function's options.
this helps