Custom ContextMenu Problem

G

Guest

Hi,

[ Using C# in .Net 1.1 ]

I've created an owner drawn context menu, however, the actual popup menu
window is always wider than the widest menu item in my context menu.
Example, when I trace through my code the widest item is 154 pixels, however
the actual popup window frame is about 170 pixels wide. This wouldnt
normally be much of a problem, but I am drawing a rectangle selection box
around each item when keyboard or mouse selected. [ I keep a record of the
widest item and this selection box is always that width. ] Because of this
extra area in the popup menu my box isnt extending all of the way across the
popup menu.

I've created my own MeasureItem and DrawItem methods, do I need to do
anything else to get this working ?

RichS
 
G

Guest

In the end I solved the problem. I was originally calculating the display
width from the individual items in the menu - and monitored which was the
widest entry and then used that as the width. In the end I re-worked the
code and took the width of the menu itself and this solved my problem.

Rich.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top