Can I restrict the size of a menu ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a situation where I add over a hundred child MenuItems to a parent
MenuItem. When I click the parent which shows a listing of all the child menu
items, it is too big to fit on the page, so it has these up/down arrows so
you can scroll through it. This is great, except this window it drew takes
the entire height of my screen so it looks a little silly. How can I restrict
the size of this menu, so it shows only like 20 menu items and then you can
scroll through to find the others that cnanot be shown?
 
Hi Mr.

I'm affraid that only solution is writing own MenuItem implementing
class or use not-standard Menu component that allow that action.

There is a simple trick that can be usefull in your problem.
- Add MenuItems with every 20th position step with text e.g.
">> next >>", and "<< prev <<" (every 20th step starting
with 21st)
- Handle "NEXT"s "Click" event with action that hide current
20 menu items and show next 20 items. This handler can be add
to all this "next-menu-items" (with checking its "Index")
- Handle "PREV"s should work like "NEXT"s but in backward.

Before you start to do this, think over that can't you put
these menu items in any submenu? Solution with more than 20
menu items will not be user friendly...

Regards!
Marcin
 
MrNobody,
In addition to the other comments, I would seriously consider doing what the
Windows menu does in MDI apps, such as VS.NET.

I would show the first 10 menu items on the Menu, plus an "More items" menu
item. The "More items" menu item would show a dialog box that displayed the
entire list (including the first 10) items in a list box or similar control.

Hope this helps
Jay
 
Back
Top