tags:

views:

98

answers:

2

Hi, By setting a MIM_MAXHEIGHT with SetMenuInfo, I can control the max height of a [popup]menu. When the menu appears, if it needs more height than MIM_MAXHEIGHT, it will have 2 scrollbuttons (one at the top, the second at the bottom)

I do draw myself the menuitems to theme them with various flavours. But my OnDrawItem or OnMeasureItem are never called for drawing the scrollbuttons.

So my question is : How to ownerdraw the scroll buttons in a scrollable Tmenu (or Tpopupmenu)? Is it even possible?

+1  A: 

Looking at the MSDN documentaiton, I don't think you can not owerdraw those buttons, as they are not part of the menu items, but of the menu itself.

The menu itself only has very few flags you can define; the only modify the background.

This link describes (an English translation of) how to to this. Or this link on the Embarcadero forum.

Jeroen Pluimers
A: 

What is possible is to set a background color to the menu (MIM_BACKGROUND) and giving to the hbrBack member a Tbrush.handle with a predefined color.

that is not perfect but often, themes use a single color to backgroud the menuitems. By this way, the scroll buttons will be colored with the background color

loursonwinny