Toolbar Button Menus
Posted on 2002-07-25
I'm attemping to create something similar to the "Fill Color" button in Excel.
For those who don't know, the "Fill Color" button has an image of a paint can with a bar in the currently selected fill color. Clicking on the drop-down arrow shows a pallet which allows you to select the fill color.
My problem is in setting the image of the button to the correct image. I know I can fill up the image list control which is attached to the tool bar, but I'd rather have a separate image list with just the fill color icons, which I then assign to the "Fill Color" button.
I can't get the button's image to change, though.
Here is the code I'm trying to use:
Private Sub tbrMain_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
imlMain.ListImages(16).Draw imlFillColor.ListImages(ButtonMenu.Index).Picture, , , imlNormal
g_sFillColor = ButtonMenu.Key
Basically, why doesn't this work, and how can I make it work?