Link to home
Start Free TrialLog in
Avatar of jlislo
jlislo

asked on

How to limit pop-up menu items?

I like to know how to setup the number of lines of pop-up menu items so it will not go out of the screen size.

Thanks.

Jammy
ASKER CERTIFIED SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jlislo
jlislo

ASKER

Russell,

This is so great. I will add 100 points more for you if you can show me how to nerrow the width of the column. If not I will accept this answer. Thank you very much

Jammy
Jammy,
Sorry, missed the last posting by you (thanks for the points btw). To answer your second question, if you want to narrow/expand the menu width, you will need to do 2 things.

1. Make sure the menu/popupmenu has OwnerDraw set to true.
2. You have to handle the OnMeasureItem for the menu items, and change the Width Setting there.  The easiest way to do this is to create one method and assign all the menu items OnMeasureItem to it.

Note: You don't have to handle the painting at all, as long as you dont assign a method to OnDrawItem.

Hope this helps,
Russell



Avatar of jlislo

ASKER

Russell,

Go to my next question "For Russell on OnMeasureItem answer". 100 points is waitting for you. Thanks you very much.

Jammy