To draw a toolbar picture after adding the toolbar resource:
Declare the CToolBar variable in the header file:
Initialize the toolbar in the initialization function:
The effect is as follows:
To modify the ID of several toolbar buttons created:
To add a message map table for processing buttons:
To declare a menu's handler function in the header file:
Implement the message handler function for the button:
The effect is as follows:
Add a message map for the 2nd button:
Declare a message handler for the 2nd button:
Implement the message handler function for the 2nd button:
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、////////////////////////////////////////////////////////// The following changes to the 24-bit true Color Picture:
Add the bitmap picture to the project folder Res folder. To add a resource:
Import Bitmap resources.
Modify the ID of the bitmap you just added
Add a 24-bit bitmap to the image list CImageList, and then add the image list CImageList to the toolbar:
The effect is as follows:
To resize a toolbar button:
The effect is as follows:
The following hot.bmp is a dark picture, copied to the Res folder to implement the button after the picture is changed, and then poured into the bitmap resource: Modify the ID of the dark picture and then save: Modify the following code:
Modify the red underline ID to Ilc_mask
From for notes (Wiz)
Cheetah Mfc--toolbar toolbar is also a 4-bit, 16-color bitmap Resource