473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can I restrict the size of a menu ?

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?
Nov 16 '05 #1
3 1359
The best answer I can give is: Don't do that!

Reconsider your design to present your users a different way of choosing
an option.

--
Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
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?

Nov 16 '05 #2
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
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?

Nov 16 '05 #3
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

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
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?

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris | last post by:
I have a fairly straight-forward form that loads preferences upon running, and saves them upon exiting. Included in the preferences are things like window size & location, working directory, etc. ...
3
by: Bilal | last post by:
Hi, I've been looking all over the net for a way to increase the size of a drop down menu without any success. Does anyone perhaps have a way to display 11-15 items on a menu without having...
1
by: news.microsoft.com | last post by:
Hi everyone, Please I'm creating a Context Menu and doing a manual Show from C#, on a different thread I need to know the window size of the Context Menu already opened, I have the object...
3
by: spielmann | last post by:
Hello I want to change the scrollbar size of windows, How can I do that with vb.net I have find this in VB6 but how can we convert simply this code. thx
21
by: Niu Xiao | last post by:
I see a lot of use in function declarations, such as size_t fread(void* restrict ptr, size_t size, size_t nobj, FILE* restrict fp); but what does the keyword 'restrict' mean? there is no...
53
by: Jonas Smithson | last post by:
In his book "CSS: The Definitive Guide" 2nd edition (pgs. 116-117), Eric Meyer has an interesting discussion about "font-size-adjust" that was evidently dropped in CSS 2.1 due to browser...
1
by: elusified | last post by:
Hi guys, i am now doin this website that required a floating menu. the problem is how do i restrict the floating menu to prevent it from goin out of the navigation area when the window is minimize?...
2
by: Swan | last post by:
How can I restrict alt+tab and start menu from keyboard while program executing(VB)?I am posting what I tried-- form.frm Option Explicit Private Sub Form_Load() HookKeyboard End Sub...
4
by: chazzy69 | last post by:
The problem is as follows, i am inputing text and images from another source via my php script, now when i try to display the text and images into a page of my own styling the text and images skewed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.