VB6 Menu Problem

Background:
In my VB6 MDI application, the MDI form has quite a few menus. There are 10 main menus, each with up to 8 or so submenus. In several places, some of those submenus contain submenus of their own. So at most the menus nest to three levels.
When the user selects a menu item, I disable certain other menu items that can't be available while the user is "in" the menu (most of the menus open a child form). When the user closes from the form involved, I enable the menus I disabled. It can get quite complex because when one menu is entered, several get disabled, but there are others that remain available. If the user selects one of those, I disable the appropriate items for that selection, taking into account whether they have been disabled by a previous selection. I accomplish this with a dynamic array that keeps track of what menus are disabled by what other menus. It all works really well.
However I have a problem. Sometimes I run into a runtime error because you can't disable all of the visible submenus for a menu. It makes sense, of course, otherwise you could choose a menu and see all disabled options, which isn't good form.
My latest solution is to model the menu structure completely in an array. I perform the changes on the array when enabling/disabling menus, then check for the error situation and disable the parent menu if all of its submenus are disabled. I then have to carefully apply the changes from the array to the actual menus on the form. The best I can do has me looping through all those menus 3 times. This is because I can't disable all submenus and then disable the parent menu. I have to do the parent(s) first. All in all, it is too complex, slow and isn't satisfactory.

Questions:
1. Anyone had this problem before? Is there a "standard" solution to this I have never seen?
2. Should I go entirely another way? - I've been toying with generating the entire menu structure dynamically at runtime - that way, instead of enabling/disabling menu items, I can re-generate only the available ones. Doesn't sound very GUI-compliant, though.
3. Anyone know of a robust active-x menu control that doesn't have this limitation? (this is a commercial app I'm writing, the component has to be tried and tested).
Thanks
Zukes
ZukesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fantasy1001Commented:
Why don't set the popup form in modal mode, in which the user cannot access at all the menu,
0
clanglCommented:
Can you instead of disabling them make the visible property false?  Just a thought.
0
Dang123Commented:

I forget where I read it, but a few people suggest not disabling menu options, instead put up a message box when a menu item is used when it shouldn't be. The message box should describe when the item is really available. This is supposed to prevent confusion for the non PC-literate as the menu system won't change constantly and the user can find out exactly how to get a menu item active ( A quote from one of my users trying Word went something like this once "Now why can't I cut this paragraph!!?? My blinking thing is in it!!!")

Doing this, would also prevent your problem of having all menu items disabled in any given sub menu. You said you are already keeping any array that indicates if a menu item should be enabled or not, use it to check if the message box should come up or the function should be called.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ashooooCommented:
Disabling the parent menu is not a good idea. And its not standard too.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZukesAuthor Commented:

Hmmm. Ashoooo, I just ran a few office apps and the VB IDE. You are right... I can see instances where a menu is available and all of its submenus are disabled. If Microsoft does it, it must be ok (!). Why have they built in this dumb rule into their menu control? I guess that means I need another menu control?

0
fantasy1001Commented:
In term of MDI, when there is a parent menu which is on the mdi form, if we also add a menu into the child, when the child active, it will use the child menu.

For your case, you can create the menu for each child, for example, when you are creating the menu for the child, then disable directly the menu you don't want. Get it??

Thanks
~ fantasy ~
0
ashooooCommented:
Zukes, I guess the menu isnt disabled even though the children are disabled is because so that the user knows that these submenus 'might' be available at a later stage.

You can selectively disable the child menus and keep the parent enabled.
0
ZukesAuthor Commented:

Folks, I've messed up.
I've found the problem and it wasn't what I thought.
I can disable all the submenus for a menu and leave the parent enabled.
I didn't investigate the problem enough.
The runtime error occurs when I try to disable a MENU BAR.
I'm sorry to have wasted your time on this.

I will contact the Experts Exchange co-ordinator and see how allocate points
on this. I shall allocate some.
Sorry to have wasted your time and thanks for the comments.

Regards
Zukes (The Unthorough)
0
ZukesAuthor Commented:

I've split points based on how much your comments prompted me to solve this.
Thanks & regards,
Zukes
0
clanglCommented:
Zukes,
Thanks for the points!!!  DOn't worry about wasting my time.  It is all learning to me.
0
ashooooCommented:
Thanks for the points... was glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.